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>
This commit is contained in:
parent
d9fe4b6944
commit
3982b5030e
|
@ -519,6 +519,7 @@ handle_message(struct serialqueue *sq, double eventtime, int len)
|
||||||
struct queue_message *qm = message_fill(sq->input_buf, len);
|
struct queue_message *qm = message_fill(sq->input_buf, len);
|
||||||
qm->sent_time = sq->last_receive_sent_time;
|
qm->sent_time = sq->last_receive_sent_time;
|
||||||
qm->receive_time = get_monotonic(); // must be time post read()
|
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);
|
list_add_tail(&qm->node, &sq->receive_queue);
|
||||||
check_wake_receive(sq);
|
check_wake_receive(sq);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue