Merge pull request 'add data in POST and process event' (#4) from post-data into main
Reviewed-on: #4
This commit is contained in:
commit
67443c53bf
@ -223,8 +223,8 @@ def main():
|
|||||||
events_emits_def = []
|
events_emits_def = []
|
||||||
|
|
||||||
emit_def = ""
|
emit_def = ""
|
||||||
emit_def += "void {filename}_emit{Event}({filename}* me, uint16_t t) {\n"
|
emit_def += "void {filename}_emit{Event}({filename}* me, uint16_t t, int64_t data) {\n"
|
||||||
emit_def += " POST(me, &{filename}_processEvent, ev{fn}{event}, t, 0);\n"
|
emit_def += " POST(me, &{filename}_processEvent, ev{fn}{event}, t, data);\n"
|
||||||
emit_def += "}"
|
emit_def += "}"
|
||||||
emit_def = emit_def.replace("{filename}", fn_uc).replace("{fn}", variables["fn"])
|
emit_def = emit_def.replace("{filename}", fn_uc).replace("{fn}", variables["fn"])
|
||||||
|
|
||||||
@ -241,8 +241,9 @@ def main():
|
|||||||
emit_dec += " * Emit the {event} event\n"
|
emit_dec += " * Emit the {event} event\n"
|
||||||
emit_dec += " * @param me the {filename} itself\n"
|
emit_dec += " * @param me the {filename} itself\n"
|
||||||
emit_dec += " * @param t time to wait in ms before triggering event\n"
|
emit_dec += " * @param t time to wait in ms before triggering event\n"
|
||||||
|
emit_dec += " * @param data data to put on the event for XF\n"
|
||||||
emit_dec += " */\n"
|
emit_dec += " */\n"
|
||||||
emit_dec += "void {filename}_emit{Event}({filename}* me, uint16_t t);"
|
emit_dec += "void {filename}_emit{Event}({filename}* me, uint16_t t, int64_t data);"
|
||||||
emit_dec = emit_dec.replace("{filename}", fn_uc)
|
emit_dec = emit_dec.replace("{filename}", fn_uc)
|
||||||
|
|
||||||
for event in events[1:]:
|
for event in events[1:]:
|
||||||
|
@ -22,6 +22,7 @@ bool ${filename}_processEvent(Event* ev) {
|
|||||||
${filename}* me = (${filename}*)Event_getTarget(ev);
|
${filename}* me = (${filename}*)Event_getTarget(ev);
|
||||||
${filename}_STATES oldState = me->state;
|
${filename}_STATES oldState = me->state;
|
||||||
evIDT evid = Event_getId(ev);
|
evIDT evid = Event_getId(ev);
|
||||||
|
uint64_t data = Event_getData(ev);
|
||||||
|
|
||||||
switch (me->state) { // onState
|
switch (me->state) { // onState
|
||||||
case ST${fn}_INIT:
|
case ST${fn}_INIT:
|
||||||
|
Loading…
Reference in New Issue
Block a user