serialqueue: Remove serialqueue_flush_ready()

The serialqueue_flush_ready() code was used to flush queue_step
commands during a homing operation.  It's no longer necessary now that
moves during a homing operation use the normal message priority
system.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2016-12-30 17:22:05 -05:00
parent 6bd5f4e44e
commit c552ba06b4
4 changed files with 1 additions and 18 deletions

View File

@ -66,7 +66,6 @@ defs_serialqueue = """
void serialqueue_set_baud_adjust(struct serialqueue *sq, double baud_adjust); void serialqueue_set_baud_adjust(struct serialqueue *sq, double baud_adjust);
void serialqueue_set_clock_est(struct serialqueue *sq, double est_clock void serialqueue_set_clock_est(struct serialqueue *sq, double est_clock
, double last_ack_time, uint64_t last_ack_clock); , double last_ack_time, uint64_t last_ack_clock);
void serialqueue_flush_ready(struct serialqueue *sq);
void serialqueue_get_stats(struct serialqueue *sq, char *buf, int len); void serialqueue_get_stats(struct serialqueue *sq, char *buf, int len);
int serialqueue_extract_old(struct serialqueue *sq, int sentq int serialqueue_extract_old(struct serialqueue *sq, int sentq
, struct pull_queue_message *q, int max); , struct pull_queue_message *q, int max);

View File

@ -167,8 +167,6 @@ class SerialReader:
def send_with_response(self, cmd, name): def send_with_response(self, cmd, name):
src = SerialRetryCommand(self, cmd, name) src = SerialRetryCommand(self, cmd, name)
return src.get_response() return src.get_response()
def send_flush(self):
self.ffi_lib.serialqueue_flush_ready(self.serialqueue)
def alloc_command_queue(self): def alloc_command_queue(self):
return self.ffi_main.gc(self.ffi_lib.serialqueue_alloc_commandqueue(), return self.ffi_main.gc(self.ffi_lib.serialqueue_alloc_commandqueue(),
self.ffi_lib.serialqueue_free_commandqueue) self.ffi_lib.serialqueue_free_commandqueue)

View File

@ -356,7 +356,6 @@ struct serialqueue {
struct list_head pending_queues; struct list_head pending_queues;
int ready_bytes, stalled_bytes; int ready_bytes, stalled_bytes;
uint64_t need_kick_clock; uint64_t need_kick_clock;
int can_delay_writes;
// Received messages // Received messages
struct list_head receive_queue; struct list_head receive_queue;
// Debugging // Debugging
@ -695,11 +694,9 @@ check_send_command(struct serialqueue *sq, double eventtime)
// Check for messages to send // Check for messages to send
if (sq->ready_bytes >= MESSAGE_PAYLOAD_MAX) if (sq->ready_bytes >= MESSAGE_PAYLOAD_MAX)
return PR_NOW; return PR_NOW;
if (! sq->can_delay_writes) { if (! sq->est_clock) {
if (sq->ready_bytes) if (sq->ready_bytes)
return PR_NOW; return PR_NOW;
if (sq->est_clock)
sq->can_delay_writes = 1;
sq->need_kick_clock = MAX_CLOCK; sq->need_kick_clock = MAX_CLOCK;
return PR_NEVER; return PR_NEVER;
} }
@ -986,16 +983,6 @@ serialqueue_set_clock_est(struct serialqueue *sq, double est_clock
pthread_mutex_unlock(&sq->lock); pthread_mutex_unlock(&sq->lock);
} }
// Flush all messages in a "ready" state
void
serialqueue_flush_ready(struct serialqueue *sq)
{
pthread_mutex_lock(&sq->lock);
sq->can_delay_writes = 0;
pthread_mutex_unlock(&sq->lock);
kick_bg_thread(sq);
}
// Return a string buffer containing statistics for the serial port // Return a string buffer containing statistics for the serial port
void void
serialqueue_get_stats(struct serialqueue *sq, char *buf, int len) serialqueue_get_stats(struct serialqueue *sq, char *buf, int len)

View File

@ -61,7 +61,6 @@ void serialqueue_pull(struct serialqueue *sq, struct pull_queue_message *pqm);
void serialqueue_set_baud_adjust(struct serialqueue *sq, double baud_adjust); void serialqueue_set_baud_adjust(struct serialqueue *sq, double baud_adjust);
void serialqueue_set_clock_est(struct serialqueue *sq, double est_clock void serialqueue_set_clock_est(struct serialqueue *sq, double est_clock
, double last_ack_time, uint64_t last_ack_clock); , double last_ack_time, uint64_t last_ack_clock);
void serialqueue_flush_ready(struct serialqueue *sq);
void serialqueue_get_stats(struct serialqueue *sq, char *buf, int len); void serialqueue_get_stats(struct serialqueue *sq, char *buf, int len);
int serialqueue_extract_old(struct serialqueue *sq, int sentq int serialqueue_extract_old(struct serialqueue *sq, int sentq
, struct pull_queue_message *q, int max); , struct pull_queue_message *q, int max);