diff --git a/sys/include/trickle.h b/sys/include/trickle.h index bad211810209..f2c671feefe0 100644 --- a/sys/include/trickle.h +++ b/sys/include/trickle.h @@ -58,7 +58,6 @@ typedef struct { trickle_callback_t callback; /**< callback function and parameter that trickle calls after each interval */ msg_t msg; /**< the msg_t to use for intervals */ - uint64_t msg_time; /**< interval in ms */ xtimer_t msg_timer; /**< xtimer to send a msg_t to the target thread for a new interval */ } trickle_t; diff --git a/sys/trickle/trickle.c b/sys/trickle/trickle.c index 1a36723ad6b8..cad07fd6d03d 100644 --- a/sys/trickle/trickle.c +++ b/sys/trickle/trickle.c @@ -51,8 +51,8 @@ void trickle_interval(trickle_t *trickle) /* old_interval == trickle->I / 2 */ trickle->t = random_uint32_range(old_interval, trickle->I); - trickle->msg_time = (trickle->t + diff) * MS_PER_SEC; - xtimer_set_msg64(&trickle->msg_timer, trickle->msg_time, &trickle->msg, + uint64_t msg_time = (trickle->t + diff) * US_PER_MS; + xtimer_set_msg64(&trickle->msg_timer, msg_time, &trickle->msg, trickle->pid); }