The alarm family of functions are used for creating alarms which call a callback or wake up waiting threads after a period of time.
Alarms can be one shot alarms which trigger once after a period of time, or periodic which trigger at regular intervals until they are cancelled.
#define OS_ALARM_QUEUE_TAG 0x614C6D51u |
#define OS_ALARM_TAG 0x614C724Du |
void OSCancelAlarms |
( |
uint32_t |
group | ) |
|
Cancel all alarms which have a matching tag set by OSSetAlarmTag.
- Parameters
-
group | The alarm tag to cancel. |
void OSCreateAlarm |
( |
OSAlarm * |
alarm | ) |
|
Initialise an alarm structure.
void OSCreateAlarmEx |
( |
OSAlarm * |
alarm, |
|
|
const char * |
name |
|
) |
| |
Initialise an alarm structure with a name.
void* OSGetAlarmUserData |
( |
OSAlarm * |
alarm | ) |
|
Return user data set by OSSetAlarmUserData.
Initialise an alarm queue structure.
void OSInitAlarmQueueEx |
( |
OSAlarmQueue * |
queue, |
|
|
const char * |
name |
|
) |
| |
Initialise an alarm queue structure with a name.
Set a one shot alarm to perform a callback after a set amount of time.
- Parameters
-
alarm | The alarm to set. |
time | The duration until the alarm should be triggered. |
callback | The alarm callback to call when the alarm is triggered. |
Set a repeated alarm to execute a callback every interval from start.
- Parameters
-
alarm | The alarm to set. |
start | The duration until the alarm should first be triggered. |
interval | The interval between triggers after the first trigger. |
callback | The alarm callback to call when the alarm is triggered. |
void OSSetAlarmTag |
( |
OSAlarm * |
alarm, |
|
|
uint32_t |
group |
|
) |
| |
Set an alarm tag which is used in OSCancelAlarms for bulk cancellation.
void OSSetAlarmUserData |
( |
OSAlarm * |
alarm, |
|
|
void * |
data |
|
) |
| |
Set alarm user data which is returned by OSGetAlarmUserData.
Sleep the current thread until the alarm has been triggered or cancelled.