From c552ba06b4886d400e235267b23f86f44260bb92 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 30 Dec 2016 17:22:05 -0500 Subject: [PATCH] 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 --- klippy/chelper.py | 1 - klippy/serialhdl.py | 2 -- klippy/serialqueue.c | 15 +-------------- klippy/serialqueue.h | 1 - 4 files changed, 1 insertion(+), 18 deletions(-) diff --git a/klippy/chelper.py b/klippy/chelper.py index 3603d839..f979e2c7 100644 --- a/klippy/chelper.py +++ b/klippy/chelper.py @@ -66,7 +66,6 @@ defs_serialqueue = """ void serialqueue_set_baud_adjust(struct serialqueue *sq, double baud_adjust); void serialqueue_set_clock_est(struct serialqueue *sq, double est_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); int serialqueue_extract_old(struct serialqueue *sq, int sentq , struct pull_queue_message *q, int max); diff --git a/klippy/serialhdl.py b/klippy/serialhdl.py index f09c4cd1..143fd138 100644 --- a/klippy/serialhdl.py +++ b/klippy/serialhdl.py @@ -167,8 +167,6 @@ class SerialReader: def send_with_response(self, cmd, name): src = SerialRetryCommand(self, cmd, name) return src.get_response() - def send_flush(self): - self.ffi_lib.serialqueue_flush_ready(self.serialqueue) def alloc_command_queue(self): return self.ffi_main.gc(self.ffi_lib.serialqueue_alloc_commandqueue(), self.ffi_lib.serialqueue_free_commandqueue) diff --git a/klippy/serialqueue.c b/klippy/serialqueue.c index 7e8e770b..6cdd9f77 100644 --- a/klippy/serialqueue.c +++ b/klippy/serialqueue.c @@ -356,7 +356,6 @@ struct serialqueue { struct list_head pending_queues; int ready_bytes, stalled_bytes; uint64_t need_kick_clock; - int can_delay_writes; // Received messages struct list_head receive_queue; // Debugging @@ -695,11 +694,9 @@ check_send_command(struct serialqueue *sq, double eventtime) // Check for messages to send if (sq->ready_bytes >= MESSAGE_PAYLOAD_MAX) return PR_NOW; - if (! sq->can_delay_writes) { + if (! sq->est_clock) { if (sq->ready_bytes) return PR_NOW; - if (sq->est_clock) - sq->can_delay_writes = 1; sq->need_kick_clock = MAX_CLOCK; return PR_NEVER; } @@ -986,16 +983,6 @@ serialqueue_set_clock_est(struct serialqueue *sq, double est_clock 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 void serialqueue_get_stats(struct serialqueue *sq, char *buf, int len) diff --git a/klippy/serialqueue.h b/klippy/serialqueue.h index 20eefe3b..7cd3c703 100644 --- a/klippy/serialqueue.h +++ b/klippy/serialqueue.h @@ -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_clock_est(struct serialqueue *sq, double est_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); int serialqueue_extract_old(struct serialqueue *sq, int sentq , struct pull_queue_message *q, int max);