aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin O'Connor <kevin@koconnor.net>2017-09-30 15:35:20 -0400
committerKevin O'Connor <kevin@koconnor.net>2017-09-30 19:37:20 -0400
commit61ee63f3583614346f52cd74fae2d37f399f5951 (patch)
tree1dca8fad82c83fc5099dbcd20015baad920be6fe
parent6f65ba9214777098278450bf9100157563b4ea94 (diff)
downloadkutter-61ee63f3583614346f52cd74fae2d37f399f5951.tar.gz
kutter-61ee63f3583614346f52cd74fae2d37f399f5951.tar.xz
kutter-61ee63f3583614346f52cd74fae2d37f399f5951.zip
serialqueue: Don't report sent_time on responses that are retransmitted
On a retransmit, the sent_time of the command associated with the given response message isn't accurate. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r--klippy/serialqueue.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/klippy/serialqueue.c b/klippy/serialqueue.c
index ceb90672..afdcc297 100644
--- a/klippy/serialqueue.c
+++ b/klippy/serialqueue.c
@@ -517,7 +517,8 @@ handle_message(struct serialqueue *sq, double eventtime, int len)
if (len > MESSAGE_MIN) {
// Add message to receive queue
struct queue_message *qm = message_fill(sq->input_buf, len);
- qm->sent_time = sq->last_receive_sent_time;
+ qm->sent_time = (rseq > sq->retransmit_seq
+ ? sq->last_receive_sent_time : 0.);
qm->receive_time = get_monotonic(); // must be time post read()
qm->receive_time -= sq->baud_adjust * len;
list_add_tail(&qm->node, &sq->receive_queue);