diff --git a/src/template.c b/src/template.c index abb8840..67f396e 100644 --- a/src/template.c +++ b/src/template.c @@ -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); } \ No newline at end of file diff --git a/src/template.h b/src/template.h index f6bda9d..46c652f 100644 --- a/src/template.h +++ b/src/template.h @@ -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