diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-09-26 21:47:13 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-09-26 22:27:25 -0400 |
commit | 3982b5030e253f68c36a4851ffba5981a471e1bb (patch) | |
tree | 0f57181976886f4ba3e8a5874fcc3858e5f6885d /klippy/serialqueue.c | |
parent | d9fe4b6944a31d490f12760b26001ba212fd76b5 (diff) | |
download | kutter-3982b5030e253f68c36a4851ffba5981a471e1bb.tar.gz kutter-3982b5030e253f68c36a4851ffba5981a471e1bb.tar.xz kutter-3982b5030e253f68c36a4851ffba5981a471e1bb.zip |
serialqueue: Take baud_adjust into account when calculating receive_time
Use baud_adjust when determining the receive_time of a message read
from the serial port. This improves the accuracy of the clock
synchronization code.
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
Diffstat (limited to 'klippy/serialqueue.c')
-rw-r--r-- | klippy/serialqueue.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/klippy/serialqueue.c b/klippy/serialqueue.c index 7247022a..ceb90672 100644 --- a/klippy/serialqueue.c +++ b/klippy/serialqueue.c @@ -519,6 +519,7 @@ handle_message(struct serialqueue *sq, double eventtime, int len) struct queue_message *qm = message_fill(sq->input_buf, len); qm->sent_time = sq->last_receive_sent_time; 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); check_wake_receive(sq); } |