TSCH: use RTIMER_CLOCK_DIFF to compute estimated drift, fixing a bug that would occur on 16-bit rtimer platforms

This commit is contained in:
Simon Duquennoy 2016-04-23 00:19:21 +02:00 committed by Simon Duquennoy
parent 5b5f07ba52
commit bb5e5d5c6b
14 changed files with 24 additions and 22 deletions

View file

@ -737,7 +737,7 @@ PT_THREAD(tsch_rx_slot(struct pt *pt, struct rtimer *t))
if(linkaddr_cmp(&destination_address, &linkaddr_node_addr)
|| linkaddr_cmp(&destination_address, &linkaddr_null)) {
int do_nack = 0;
estimated_drift = ((int32_t)expected_rx_time - (int32_t)rx_start_time);
estimated_drift = RTIMER_CLOCK_DIFF(expected_rx_time, rx_start_time);
#if TSCH_TIMESYNC_REMOVE_JITTER
/* remove jitter due to measurement errors */