1
0
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:
Kaspar Schleiser 2022-02-09 12:54:16 +01:00
parent 74741fb905
commit b15d1c127b
2 changed files with 12 additions and 0 deletions

View File

@ -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
*

View File

@ -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