mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-27 23:41:18 +01:00
sys/xtimer: introduce xtimer_is_set()
This commit is contained in:
parent
74741fb905
commit
b15d1c127b
@ -310,6 +310,13 @@ static inline void xtimer_set64(xtimer_t *timer, uint64_t offset_us);
|
||||
*/
|
||||
void xtimer_remove(xtimer_t *timer);
|
||||
|
||||
/**
|
||||
* @brief state if an xtimer is currently set (waiting to be expired)
|
||||
*
|
||||
* @param[in] timer ptr to timer structure to work on
|
||||
*/
|
||||
static inline bool xtimer_is_set(const xtimer_t *timer);
|
||||
|
||||
/**
|
||||
* @brief Convert microseconds to xtimer ticks
|
||||
*
|
||||
|
||||
@ -324,6 +324,11 @@ static inline bool xtimer_less64(xtimer_ticks64_t a, xtimer_ticks64_t b)
|
||||
return (a.ticks64 < b.ticks64);
|
||||
}
|
||||
|
||||
static inline bool xtimer_is_set(const xtimer_t *timer)
|
||||
{
|
||||
return timer->offset || timer->long_offset;
|
||||
}
|
||||
|
||||
#endif /* !defined(DOXYGEN) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user