1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

event_periodic_callback: add getter for interval & count

This commit is contained in:
Benjamin Valentin 2024-02-01 17:11:37 +01:00
parent d00fdcb301
commit 7cbf516e3b

View File

@ -97,6 +97,18 @@ static inline void event_periodic_callback_start(event_periodic_callback_t *even
event_periodic_start(&event->periodic, interval);
}
/**
* @brief Get the interval in which the periodic callback event repeats
*
* @param[in] event event_periodic_callback context object to use
*
* @returns The interval of the underlying timer in which the event repeats
*/
static inline uint32_t event_periodic_callback_get_interval(const event_periodic_callback_t *event)
{
return event->periodic.timer.interval;
}
/**
* @brief Set the amount of times the periodic callback event should repeat itself.
*
@ -110,6 +122,18 @@ static inline void event_periodic_callback_set_count(event_periodic_callback_t *
event_periodic_set_count(&event->periodic, count);
}
/**
* @brief Get the amount of times the periodic callback event should repeat itself.
*
* @param[in] event event_periodic_callback context object to use
* @returns times the event should repeat itself,
* EVENT_PERIODIC_FOREVER if it will repeat forever or is exhausted
*/
static inline uint32_t event_periodic_callback_get_count(const event_periodic_callback_t *event)
{
return event->periodic.count;
}
/**
* @brief Stop a periodic callback event
*