2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _DOLPHIN_OSALARM
|
|
|
|
#define _DOLPHIN_OSALARM
|
2022-09-10 20:32:26 +00:00
|
|
|
|
|
|
|
#include <dolphin/os/OSContext.h>
|
2022-09-18 06:05:46 +00:00
|
|
|
#include <types.h>
|
2022-09-10 20:32:26 +00:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
|
|
|
typedef struct OSAlarm OSAlarm;
|
|
|
|
typedef void (*OSAlarmHandler)(OSAlarm* alarm, OSContext* context);
|
|
|
|
|
|
|
|
struct OSAlarm {
|
|
|
|
OSAlarmHandler handler;
|
|
|
|
u32 tag;
|
|
|
|
OSTime fire;
|
|
|
|
OSAlarm* prev;
|
|
|
|
OSAlarm* next;
|
|
|
|
OSTime period;
|
|
|
|
OSTime start;
|
|
|
|
};
|
|
|
|
|
2022-10-05 01:31:43 +00:00
|
|
|
void OSInitAlarm(void);
|
2022-09-10 20:32:26 +00:00
|
|
|
void OSSetAlarm(OSAlarm* alarm, OSTime tick, OSAlarmHandler handler);
|
2022-10-05 01:31:43 +00:00
|
|
|
void OSSetAlarmTag(OSAlarm* alarm, u32 tag);
|
|
|
|
void OSSetAbsAlarm(OSAlarm* alarm, OSTime time, OSAlarmHandler handler);
|
2022-10-01 06:19:09 +00:00
|
|
|
void OSSetPeriodicAlarm(OSAlarm* alarm, OSTime start, OSTime period, OSAlarmHandler handler);
|
2022-10-05 01:31:43 +00:00
|
|
|
void OSCreateAlarm(OSAlarm* alarm);
|
2022-10-01 06:19:09 +00:00
|
|
|
void OSCancelAlarm(OSAlarm* alarm);
|
2022-10-05 01:31:43 +00:00
|
|
|
void OSCancelAlarms(u32 tag);
|
|
|
|
|
|
|
|
BOOL OSCheckAlarmQueue(void);
|
2022-10-01 06:19:09 +00:00
|
|
|
|
2022-09-10 20:32:26 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _DOLPHIN_OSALARM
|