30 #define OS_ALARM_QUEUE_TAG 0x614C6D51u 61 #define OS_ALARM_TAG 0x614C724Du 107 WUT_CHECK_OFFSET(
OSAlarm, 0x00, tag);
108 WUT_CHECK_OFFSET(
OSAlarm, 0x04, name);
109 WUT_CHECK_OFFSET(
OSAlarm, 0x0c, callback);
110 WUT_CHECK_OFFSET(
OSAlarm, 0x10, group);
111 WUT_CHECK_OFFSET(
OSAlarm, 0x18, nextFire);
112 WUT_CHECK_OFFSET(
OSAlarm, 0x20, link);
113 WUT_CHECK_OFFSET(
OSAlarm, 0x28, period);
114 WUT_CHECK_OFFSET(
OSAlarm, 0x30, start);
115 WUT_CHECK_OFFSET(
OSAlarm, 0x38, userData);
116 WUT_CHECK_OFFSET(
OSAlarm, 0x3c, state);
117 WUT_CHECK_OFFSET(
OSAlarm, 0x40, threadQueue);
118 WUT_CHECK_OFFSET(
OSAlarm, 0x50, alarmQueue);
119 WUT_CHECK_OFFSET(
OSAlarm, 0x54, context);
void(* OSAlarmCallback)(OSAlarm *, OSContext *)
OSTime period
The period between alarm triggers, this is only set for periodic alarms.
BOOL OSSetAlarm(OSAlarm *alarm, OSTime time, OSAlarmCallback callback)
Set a one shot alarm to perform a callback after a set amount of time.
uint32_t group
Used with OSCancelAlarms for bulk cancellation of alarms.
OSTime start
The time the alarm was started.
OSAlarmLink link
Link used for when this OSAlarm object is inside an OSAlarmQueue.
OSAlarmQueue * alarmQueue
The queue that this alarm is currently in.
BOOL OSCancelAlarm(OSAlarm *alarm)
Cancel an alarm.
void OSCreateAlarmEx(OSAlarm *alarm, const char *name)
Initialise an alarm structure with a name.
const char * name
Name set by OSInitAlarmQueueEx.
OSThreadQueue threadQueue
uint32_t state
The current state of the alarm, internal values.
void OSInitAlarmQueueEx(OSAlarmQueue *queue, const char *name)
Initialise an alarm queue structure with a name.
uint32_t tag
Should always be set to the value OS_ALARM_QUEUE_TAG.
void * OSGetAlarmUserData(OSAlarm *alarm)
Return user data set by OSSetAlarmUserData.
BOOL OSWaitAlarm(OSAlarm *alarm)
Sleep the current thread until the alarm has been triggered or cancelled.
OSAlarmCallback callback
The callback to execute once the alarm is triggered.
void OSSetAlarmUserData(OSAlarm *alarm, void *data)
Set alarm user data which is returned by OSGetAlarmUserData.
void OSInitAlarmQueue(OSAlarmQueue *queue)
Initialise an alarm queue structure.
void * userData
User data set with OSSetAlarmUserData and retrieved with OSGetAlarmUserData.
BOOL OSSetPeriodicAlarm(OSAlarm *alarm, OSTime start, OSTime interval, OSAlarmCallback callback)
Set a repeated alarm to execute a callback every interval from start.
void OSCreateAlarm(OSAlarm *alarm)
Initialise an alarm structure.
OSContext * context
The context the alarm was triggered on.
OSTime nextFire
The time when the alarm will next be triggered.
void OSSetAlarmTag(OSAlarm *alarm, uint32_t group)
Set an alarm tag which is used in OSCancelAlarms for bulk cancellation.
void OSCancelAlarms(uint32_t group)
Cancel all alarms which have a matching tag set by OSSetAlarmTag.