mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-16 01:53:51 +01:00
sys/ztimer: Name callback types
This commit is contained in:
parent
7e587b068e
commit
f3e462d039
@ -288,6 +288,11 @@ typedef struct ztimer_base ztimer_base_t;
|
||||
*/
|
||||
typedef struct ztimer_clock ztimer_clock_t;
|
||||
|
||||
/**
|
||||
* @brief Type of callbacks in @ref ztimer_t "timers"
|
||||
*/
|
||||
typedef void (*ztimer_callback_t)(void *arg);
|
||||
|
||||
/**
|
||||
* @brief Minimum information for each timer
|
||||
*/
|
||||
@ -310,7 +315,7 @@ typedef uint32_t ztimer_now_t; /**< type for ztimer_now() result */
|
||||
*/
|
||||
typedef struct {
|
||||
ztimer_base_t base; /**< clock list entry */
|
||||
void (*callback)(void *arg); /**< timer callback function pointer */
|
||||
ztimer_callback_t callback; /**< timer callback function pointer */
|
||||
void *arg; /**< timer callback argument */
|
||||
} ztimer_t;
|
||||
|
||||
|
||||
@ -80,6 +80,11 @@ extern "C" {
|
||||
*/
|
||||
#define ZTIMER_PERIODIC_KEEP_GOING true
|
||||
|
||||
/**
|
||||
* @brief Type of callbacks in @ref ztimer_periodic_t "periodic timers"
|
||||
*/
|
||||
typedef bool (*ztimer_periodic_callback_t)(void *);
|
||||
|
||||
/**
|
||||
* @brief ztimer periodic structure
|
||||
*/
|
||||
@ -88,7 +93,7 @@ typedef struct {
|
||||
ztimer_clock_t *clock; /**< clock for this timer */
|
||||
uint32_t interval; /**< interval of this timer */
|
||||
ztimer_now_t last; /**< last trigger time */
|
||||
bool (*callback)(void *); /**< called on each trigger */
|
||||
ztimer_periodic_callback_t callback; /**< called on each trigger */
|
||||
void *arg; /**< argument for callback */
|
||||
} ztimer_periodic_t;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user