PebbleOS
Loading...
Searching...
No Matches
Macros | Typedefs | Functions
evented_timer.h File Reference
#include <stdbool.h>
#include <stdint.h>
#include <kernel/pebble_tasks.h>

Macros

#define EVENTED_TIMER_INVALID_ID   0
 Invalid timer handle.
 

Typedefs

typedef uintptr_t EventedTimerID
 Evented timer handle.
 
typedef void(* EventedTimerCallback) (void *data)
 Timer callback, run on the task that registered the timer.
 

Functions

void evented_timer_init (void)
 Initialize the evented timer service, once at startup.
 
void evented_timer_clear_process_timers (PebbleTask task)
 Cancel all timers of a task, without calling their callbacks.
 
EventedTimerID evented_timer_register (uint32_t timeout_ms, bool repeating, EventedTimerCallback callback, void *callback_data)
 Start a timer.
 
bool evented_timer_reschedule (EventedTimerID timer, uint32_t new_timeout_ms)
 Restart a pending timer with a new timeout.
 
EventedTimerID evented_timer_register_or_reschedule (EventedTimerID timer_id, uint32_t timeout_ms, EventedTimerCallback callback, void *data)
 Reschedule a timer, or register a new one-shot timer if that is not possible.
 
void evented_timer_cancel (EventedTimerID timer)
 Cancel a timer.
 
bool evented_timer_exists (EventedTimerID timer)
 Check whether a timer exists.
 
bool evented_timer_is_current_task (EventedTimerID timer)
 Check whether a timer belongs to the current task.
 
void evented_timer_reset (void)
 Forget all timers, without freeing them.
 
void * evented_timer_get_data (EventedTimerID timer)
 Get the callback data of a timer.