From c6c360c4e14374a56dcb0477e1e7759683841093 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Fri, 14 Feb 2020 20:47:08 -0500 Subject: serialqueue: Support notification of when a command is processed Add ability for the host code to get a notification when the ack for a command sent to the micro-controller is received. This is in preparation for improved detection of message loss between mcu and host. Signed-off-by: Kevin O'Connor --- klippy/chelper/serialqueue.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'klippy/chelper/serialqueue.h') diff --git a/klippy/chelper/serialqueue.h b/klippy/chelper/serialqueue.h index 807e9883..071923e5 100644 --- a/klippy/chelper/serialqueue.h +++ b/klippy/chelper/serialqueue.h @@ -32,6 +32,7 @@ struct queue_message { double sent_time, receive_time; }; }; + uint64_t notify_id; struct list_node node; }; @@ -42,6 +43,7 @@ struct pull_queue_message { uint8_t msg[MESSAGE_MAX]; int len; double sent_time, receive_time; + uint64_t notify_id; }; struct serialqueue; @@ -53,8 +55,8 @@ void serialqueue_free_commandqueue(struct command_queue *cq); void serialqueue_send_batch(struct serialqueue *sq, struct command_queue *cq , struct list_head *msgs); void serialqueue_send(struct serialqueue *sq, struct command_queue *cq - , uint8_t *msg, int len - , uint64_t min_clock, uint64_t req_clock); + , uint8_t *msg, int len, uint64_t min_clock + , uint64_t req_clock, uint64_t notify_id); 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_freq -- cgit v1.2.3-70-g09d2