From 3678c0043f70c9641058e4bb825c07e3b012a8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 11 Jul 2023 19:00:15 +0200 Subject: [PATCH 1/2] fix template for processEvent --- templates/file.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/templates/file.c b/templates/file.c index 558bd4e..8689cc2 100644 --- a/templates/file.c +++ b/templates/file.c @@ -19,6 +19,9 @@ void ${filename}_startBehaviour(${filename}* me){ bool ${filename}_processEvent(Event* ev) { bool processed = false; ${filename}* me = (${filename}*)Event_getTarget(ev); + ${filename}_STATES oldState = me->state; + evIDT evid = Event_getId(ev); + switch (me->state) { // onState case ST${fn}_INIT: if (ev->id == ev${fn}init) { @@ -59,4 +62,4 @@ ${EVENTS_EMITS_DEF} * SETTERS * ***********/ -${VARS_SETTERS_DEF} \ No newline at end of file +${VARS_SETTERS_DEF} -- 2.45.2 From 33906b4184de5f4f5a287d9eeddf401ebafeae45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Heredero?= Date: Tue, 11 Jul 2023 19:27:51 +0200 Subject: [PATCH 2/2] fix state init --- templates/file.h | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/file.h b/templates/file.h index a908169..b8f8bbb 100644 --- a/templates/file.h +++ b/templates/file.h @@ -10,6 +10,7 @@ #include "../xf/xf.h" typedef enum { + ST${fn}_INIT, ${STATES_ENUM} } ${filename}_STATES; -- 2.45.2