Repeating Timer functions for simple scheduling of repeated execution. More...
Data Structures | |
| struct | repeating_timer |
| Information about a repeating timer. More... | |
Typedefs | |
| typedef bool(* | repeating_timer_callback_t) (repeating_timer_t *rt) |
| Callback for a repeating timer. | |
Functions | |
| bool | alarm_pool_add_repeating_timer_us (alarm_pool_t *pool, int64_t delay_us, repeating_timer_callback_t callback, void *user_data, repeating_timer_t *out) |
| Add a repeating timer that is called repeatedly at the specified interval in microseconds. | |
| static bool | alarm_pool_add_repeating_timer_ms (alarm_pool_t *pool, int32_t delay_ms, repeating_timer_callback_t callback, void *user_data, repeating_timer_t *out) |
| Add a repeating timer that is called repeatedly at the specified interval in milliseconds. | |
| static bool | add_repeating_timer_us (int64_t delay_us, repeating_timer_callback_t callback, void *user_data, repeating_timer_t *out) |
| Add a repeating timer that is called repeatedly at the specified interval in microseconds. | |
| static bool | add_repeating_timer_ms (int32_t delay_ms, repeating_timer_callback_t callback, void *user_data, repeating_timer_t *out) |
| Add a repeating timer that is called repeatedly at the specified interval in milliseconds. | |
| bool | cancel_repeating_timer (repeating_timer_t *timer) |
| Cancel a repeating timer. | |
Repeating Timer functions for simple scheduling of repeated execution.
| typedef bool(* repeating_timer_callback_t) (repeating_timer_t *rt) |
Callback for a repeating timer.
| rt | repeating time structure containing information about the repeating time. user_data is of primary important to the user |
|
inlinestatic |
Add a repeating timer that is called repeatedly at the specified interval in milliseconds.
Generally the callback is called as soon as possible after the time specified from an IRQ handler on the core of the default alarm pool (generally core 0). If the callback is in the past or happens before the alarm setup could be completed, then this method will optionally call the callback itself and then return a return code to indicate that the target time has passed.
| delay_ms | the repeat delay in milliseconds; if >0 then this is the delay between one callback ending and the next starting; if <0 then this is the negative of the time between the starts of the callbacks. The value of 0 is treated as 1 microsecond |
| callback | the repeating timer callback function |
| user_data | user data to pass to store in the repeating_timer structure for use by the callback. |
| out | the pointer to the user owned structure to store the repeating timer info in. BEWARE this storage location must outlive the repeating timer, so be careful of using stack space |
|
inlinestatic |
Add a repeating timer that is called repeatedly at the specified interval in microseconds.
Generally the callback is called as soon as possible after the time specified from an IRQ handler on the core of the default alarm pool (generally core 0). If the callback is in the past or happens before the alarm setup could be completed, then this method will optionally call the callback itself and then return a return code to indicate that the target time has passed.
| delay_us | the repeat delay in microseconds; if >0 then this is the delay between one callback ending and the next starting; if <0 then this is the negative of the time between the starts of the callbacks. The value of 0 is treated as 1 |
| callback | the repeating timer callback function |
| user_data | user data to pass to store in the repeating_timer structure for use by the callback. |
| out | the pointer to the user owned structure to store the repeating timer info in. BEWARE this storage location must outlive the repeating timer, so be careful of using stack space |
|
inlinestatic |
Add a repeating timer that is called repeatedly at the specified interval in milliseconds.
Generally the callback is called as soon as possible after the time specified from an IRQ handler on the core the alarm pool was created on. If the callback is in the past or happens before the alarm setup could be completed, then this method will optionally call the callback itself and then return a return code to indicate that the target time has passed.
| pool | the alarm pool to use for scheduling the repeating timer (this determines which timer_alarm is used, and which core calls the callback) |
| delay_ms | the repeat delay in milliseconds; if >0 then this is the delay between one callback ending and the next starting; if <0 then this is the negative of the time between the starts of the callbacks. The value of 0 is treated as 1 microsecond |
| callback | the repeating timer callback function |
| user_data | user data to pass to store in the repeating_timer structure for use by the callback. |
| out | the pointer to the user owned structure to store the repeating timer info in. BEWARE this storage location must outlive the repeating timer, so be careful of using stack space |
| bool alarm_pool_add_repeating_timer_us | ( | alarm_pool_t * | pool, |
| int64_t | delay_us, | ||
| repeating_timer_callback_t | callback, | ||
| void * | user_data, | ||
| repeating_timer_t * | out ) |
Add a repeating timer that is called repeatedly at the specified interval in microseconds.
Generally the callback is called as soon as possible after the time specified from an IRQ handler on the core the alarm pool was created on. If the callback is in the past or happens before the alarm setup could be completed, then this method will optionally call the callback itself and then return a return code to indicate that the target time has passed.
| pool | the alarm pool to use for scheduling the repeating timer (this determines which timer_alarm is used, and which core calls the callback) |
| delay_us | the repeat delay in microseconds; if >0 then this is the delay between one callback ending and the next starting; if <0 then this is the negative of the time between the starts of the callbacks. The value of 0 is treated as 1 |
| callback | the repeating timer callback function |
| user_data | user data to pass to store in the repeating_timer structure for use by the callback. |
| out | the pointer to the user owned structure to store the repeating timer info in. BEWARE this storage location must outlive the repeating timer, so be careful of using stack space |
| bool cancel_repeating_timer | ( | repeating_timer_t * | timer | ) |
Cancel a repeating timer.
| timer | the repeating timer to cancel |