ContikiMAC: use RTIMER_GUARD_TIME #define to avoid accidentally scheduling a rtimer in the past on platforms with fast rtimer ticks

This commit is contained in:
Atis Elsts 2015-08-18 15:30:20 +02:00
parent bc17cdca2c
commit b5d17bb620
2 changed files with 21 additions and 5 deletions

View file

@ -151,6 +151,16 @@ void rtimer_arch_schedule(rtimer_clock_t t);
#define RTIMER_SECOND RTIMER_ARCH_SECOND
/* RTIMER_GUARD_TIME is the minimum amount of rtimer ticks between
the current time and the future time when a rtimer is scheduled.
Necessary to avoid accidentally scheduling a rtimer in the past
on platforms with fast rtimer ticks. Should be >= 2. */
#ifdef RTIMER_CONF_GUARD_TIME
#define RTIMER_GUARD_TIME RTIMER_CONF_GUARD_TIME
#else /* RTIMER_CONF_GUARD_TIME */
#define RTIMER_GUARD_TIME (RTIMER_ARCH_SECOND >> 14)
#endif /* RTIMER_CONF_GUARD_TIME */
#endif /* RTIMER_H_ */
/** @} */