add resurrect for alive checker
This commit is contained in:
parent
b95b6619e3
commit
7aab0ef049
@ -80,8 +80,8 @@ bool ALIVE_processEvent(Event* ev) {
|
||||
break;
|
||||
|
||||
case STAL_DEAD:
|
||||
if (ev->id == evALborn) {
|
||||
me->state = STAL_BORN;
|
||||
if (ev->id == evALresurrect) {
|
||||
me->state = STAL_SETUP;
|
||||
}
|
||||
break;
|
||||
|
||||
@ -238,6 +238,10 @@ void ALIVE_emitStart(ALIVE* me, uint16_t t, int64_t data) {
|
||||
POST(me, &ALIVE_processEvent, evALstart, t, data);
|
||||
}
|
||||
|
||||
void ALIVE_emitResurrect(ALIVE* me, uint16_t t, int64_t data) {
|
||||
POST(me, &ALIVE_processEvent, evALresurrect, t, data);
|
||||
}
|
||||
|
||||
/***********
|
||||
* SETTERS *
|
||||
***********/
|
||||
|
@ -25,7 +25,8 @@ typedef enum {
|
||||
evALborn,
|
||||
evALready,
|
||||
evALpoll,
|
||||
evALstart
|
||||
evALstart,
|
||||
evALresurrect
|
||||
} ALIVE_EVENTS;
|
||||
|
||||
typedef void (*ALIVE_CALLBACK_FUNCTION)(void*);
|
||||
@ -162,6 +163,14 @@ void ALIVE_emitPoll(ALIVE* me, uint16_t t, int64_t data);
|
||||
*/
|
||||
void ALIVE_emitStart(ALIVE* me, uint16_t t, int64_t data);
|
||||
|
||||
/**
|
||||
* Emit the resurrect event
|
||||
* @param me the ALIVE itself
|
||||
* @param t time to wait in ms before triggering event
|
||||
* @param data data to put on the event for XF
|
||||
*/
|
||||
void ALIVE_emitResurrect(ALIVE* me, uint16_t t, int64_t data);
|
||||
|
||||
|
||||
/***********
|
||||
* SETTERS *
|
||||
|
Reference in New Issue
Block a user