33 #ifndef __TSCH_ADAPTIVE_TIMESYNC_H__
34 #define __TSCH_ADAPTIVE_TIMESYNC_H__
48 #ifdef TSCH_CONF_RESYNC_WITH_SFD_TIMESTAMPS
49 #define TSCH_RESYNC_WITH_SFD_TIMESTAMPS TSCH_CONF_RESYNC_WITH_SFD_TIMESTAMPS
51 #define TSCH_RESYNC_WITH_SFD_TIMESTAMPS 0
55 #ifdef TSCH_CONF_TIMESYNC_REMOVE_JITTER
56 #define TSCH_TIMESYNC_REMOVE_JITTER TSCH_CONF_TIMESYNC_REMOVE_JITTER
58 #define TSCH_TIMESYNC_REMOVE_JITTER TSCH_RESYNC_WITH_SFD_TIMESTAMPS
64 #define TSCH_TIMESYNC_MEASUREMENT_ERROR US_TO_RTIMERTICKS(32)
69 #ifdef TSCH_CONF_BASE_DRIFT_PPM
70 #define TSCH_BASE_DRIFT_PPM TSCH_CONF_BASE_DRIFT_PPM
72 #define TSCH_BASE_DRIFT_PPM 0
76 #define TSCH_SLOTS_PER_SECOND (1000000 / TSCH_DEFAULT_TS_TIMESLOT_LENGTH)
81 extern struct tsch_neighbor *last_timesource_neighbor;
85 void tsch_timesync_update(
struct tsch_neighbor *n, uint16_t time_delta_asn, int32_t drift_correction);
87 int32_t tsch_timesync_adaptive_compensate(rtimer_clock_t delta_ticks);
Private TSCH definitions (meant for use by TSCH implementation files only) ...