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:
parent
bc17cdca2c
commit
b5d17bb620
2 changed files with 21 additions and 5 deletions
|
@ -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_ */
|
||||
|
||||
/** @} */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue