mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2024-12-29 04:50:03 +01:00
ztimer: expose ztimer_is_set() to public API
This commit is contained in:
parent
672a9affc7
commit
f5de257d58
@ -349,6 +349,17 @@ void ztimer_handler(ztimer_clock_t *clock);
|
||||
*/
|
||||
void ztimer_set(ztimer_clock_t *clock, ztimer_t *timer, uint32_t val);
|
||||
|
||||
/**
|
||||
* @brief Check if a timer is currently active
|
||||
*
|
||||
* @param[in] clock ztimer clock to operate on
|
||||
* @param[in] timer timer to check
|
||||
*
|
||||
* @return > 0 if timer is active
|
||||
* @return 0 if timer is not active
|
||||
*/
|
||||
unsigned ztimer_is_set(const ztimer_clock_t *clock, const ztimer_t *timer);
|
||||
|
||||
/**
|
||||
* @brief Remove a timer from a clock
|
||||
*
|
||||
|
@ -58,6 +58,15 @@ static unsigned _is_set(const ztimer_clock_t *clock, const ztimer_t *t)
|
||||
}
|
||||
}
|
||||
|
||||
unsigned ztimer_is_set(const ztimer_clock_t *clock, const ztimer_t *timer)
|
||||
{
|
||||
unsigned state = irq_disable();
|
||||
unsigned res = _is_set(clock, timer);
|
||||
|
||||
irq_restore(state);
|
||||
return res;
|
||||
}
|
||||
|
||||
void ztimer_remove(ztimer_clock_t *clock, ztimer_t *timer)
|
||||
{
|
||||
unsigned state = irq_disable();
|
||||
|
Loading…
Reference in New Issue
Block a user