Skip to content

Commit b3ba326

Browse files
committed
chore: Add additional files
These files should be added to the previous commit.
1 parent afccc8a commit b3ba326

File tree

2 files changed

+35
-3
lines changed

2 files changed

+35
-3
lines changed

source/sm/src/rkhsm.c

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050

5151
/* --------------------------------- Notes --------------------------------- */
5252
/* ----------------------------- Include files ----------------------------- */
53+
#include "rkhdef.h"
54+
#include "rkhevt.h"
5355
#include "rkhitl.h"
5456
#include "rkhsm.h"
5557
#include "rkhassert.h"
@@ -392,7 +394,8 @@ rkh_sm_dispatch(RKH_SM_T *me, RKH_EVT_T *pe)
392394
RKHROM RKH_ST_T *cs, *ts;
393395
RKHROM void *ets;
394396
RKHROM RKH_TR_T *tr;
395-
rbool_t isIntTrn, isCompletionEvent, isMicroStep, isCreationEvent;
397+
rbool_t isIntTrn, isCompletionEvent, isMicroStep, isCreationEvent,
398+
isPropagatedEvent;
396399
RKH_SIG_T in;
397400
#if RKH_CFG_TRC_EN == RKH_ENABLED
398401
rui8_t step;
@@ -423,7 +426,7 @@ rkh_sm_dispatch(RKH_SM_T *me, RKH_EVT_T *pe)
423426
RKH_SR_ALLOC();
424427

425428
RKH_ASSERT(me && pe);
426-
isCompletionEvent = isIntTrn = isMicroStep = RKH_FALSE;
429+
isCompletionEvent = isIntTrn = isMicroStep = isPropagatedEvent = RKH_FALSE;
427430
isCreationEvent = (pe->e == RKH_SM_CREATION_EVENT);
428431

429432
if (isCreationEvent == RKH_FALSE)
@@ -461,6 +464,15 @@ rkh_sm_dispatch(RKH_SM_T *me, RKH_EVT_T *pe)
461464
pe = (RKH_EVT_T *)&evCompletion;
462465
isCompletionEvent = RKH_FALSE;
463466
}
467+
else if (isPropagatedEvent)
468+
{
469+
pe = me->propagatedEvent;
470+
me->propagatedEvent = RKH_EVT_CAST(0);
471+
isPropagatedEvent = RKH_FALSE;
472+
}
473+
else
474+
{
475+
}
464476

465477
if (isCreationEvent == RKH_FALSE)
466478
{
@@ -753,7 +765,9 @@ rkh_sm_dispatch(RKH_SM_T *me, RKH_EVT_T *pe)
753765

754766
RKH_TR_SM_EVT_PROC(me);
755767
isCreationEvent = RKH_FALSE;
756-
} while (isCompletionEvent);
768+
isPropagatedEvent =
769+
(me->propagatedEvent != (RKH_EVT_T*)0) ? RKH_TRUE : RKH_FALSE;
770+
} while (isCompletionEvent || isPropagatedEvent);
757771

758772
INFO_EXEC_TRS(me);
759773
return RKH_EVT_PROC;
@@ -800,4 +814,11 @@ rkh_sm_else(void)
800814
}
801815
#endif
802816

817+
void
818+
rkh_sm_propagate(RKH_SM_T* me, RKH_EVT_T* e)
819+
{
820+
RKH_REQUIRE((me != (RKH_SM_T*)0) && (e != (RKH_EVT_T*)0));
821+
me->propagatedEvent = e;
822+
}
823+
803824
/* ------------------------------ End of file ------------------------------ */

tools/deploy/changelog.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
[
2+
{
3+
"version": "3.5.00",
4+
"date": "2024-13-12",
5+
"new": ["Added function rkh_sm_propagate() to propagate an event to self without using the AO's event queue.",
6+
"Added unit test cases to module rkhsm.c to demonstrate how to build periodic non-reactive/reactive active object classes."],
7+
"bugfix": [],
8+
"apichg": [],
9+
"deprecated": [],
10+
"port": [],
11+
"note": []
12+
},
213
{
314
"version": "3.4.00",
415
"date": "2021-21-06",

0 commit comments

Comments
 (0)