add time for event
This commit is contained in:
parent
b0e3d721e0
commit
dc6a7f8799
@ -20,9 +20,7 @@ bool ${FILENAME}_processEvent(Event* ev) {
|
||||
${FILENAME}* me = (${FILENAME}*)Event_getTarget(ev);
|
||||
switch (me->state) { // onState
|
||||
case ST${FN}_INIT:
|
||||
if (ev->id == ev${FN}init) {
|
||||
me->state = ST${FN}_{WAIT_STATE};
|
||||
}
|
||||
if (ev->id == ev${FN}init) {}
|
||||
break;
|
||||
{STATES}
|
||||
}
|
||||
@ -49,6 +47,6 @@ void ${FILENAME}_set{VAR}(${FILENAME}*me, uint16_t t) {
|
||||
me->tON = t;
|
||||
}
|
||||
|
||||
void ${FILENAME}_emit${EVENT}(${FILENAME}*me) {
|
||||
POST(me, &${FILENAME}_processEvent, ev${FN}${EVENT}, 0, 0);
|
||||
void ${FILENAME}_emit${EVENT}(${FILENAME}*me, uint16_t t) {
|
||||
POST(me, &${FILENAME}_processEvent, ev${FN}${EVENT}, t, 0);
|
||||
}
|
@ -47,8 +47,9 @@ void ${FILENAME}_set{TIMEON}(${FILENAME}*me, uint16_t t);
|
||||
/**
|
||||
* Emit the ${EVENT} event
|
||||
* @param me the ${FILENAME} itself
|
||||
* @param t Time to wait before trig the event
|
||||
*/
|
||||
void ${FILENAME}_emit${EVENT}(${FILENAME}*me);
|
||||
void ${FILENAME}_emit${EVENT}(${FILENAME}*me, uint16_t t);
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user