From 723c7e1117e7505145f3f69b362b03889e577f21 Mon Sep 17 00:00:00 2001 From: Atis Elsts Date: Mon, 25 Apr 2016 17:15:10 +0300 Subject: [PATCH] print TSCH clock drift ppm whenever updated --- core/net/mac/tsch/tsch-adaptive-timesync.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/core/net/mac/tsch/tsch-adaptive-timesync.c b/core/net/mac/tsch/tsch-adaptive-timesync.c index 0b4601621..6677c690d 100644 --- a/core/net/mac/tsch/tsch-adaptive-timesync.c +++ b/core/net/mac/tsch/tsch-adaptive-timesync.c @@ -92,6 +92,10 @@ timesync_learn_drift_ticks(uint32_t time_delta_asn, int32_t drift_ticks) int32_t last_drift_ppm = (int32_t)((int64_t)real_drift_ticks * TSCH_DRIFT_UNIT / time_delta_ticks); drift_ppm = timesync_entry_add(last_drift_ppm, time_delta_ticks); + + TSCH_LOG_ADD(tsch_log_message, + snprintf(log->message, sizeof(log->message), + "drift %ld", drift_ppm / 256)); } /*---------------------------------------------------------------------------*/ /* Either reset or update the neighbor's drift */