RKH
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
  1. Declaring the actions
rkh_bunner.jpg


Prev: Defining the state machine's objects
Next: Include files

All init, entry, exit, and transition actions of my state machine are implemented in "myact.c" file and declaring in "myact.h" file. These files also includes transition guard and branch selection functions.


Initial action of "my" state machine

void
my_init(const RKH_SMA_T *me)
{
MySm *realMe = ((MySm *)(me));
RKH_TR_FWK_OBJ(&my->equeue);
realMe->x = realMe->y = 0;
}

Effect actions of "my" state machine

void
set_x1(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
((MySm *)(me))->x = 1;
}
void
set_y_2(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
((MySm *)(me))->y = 2;
}
void
set_y_1(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
((MySm *)(me))->y = 1;
}
void
dummy_act(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)me;
(void)pe;
}
void
show_data(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)me;
(void)pe;
}
void
terminate(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)me;
(void)pe;
}

Entry actions of "my" state machine

void
set_x_1(const RKH_SMA_T *me)
{
((MySm *)(me))->x = 1;
}
void
set_x_2(const RKH_SMA_T *me)
{
((MySm *)(me))->x = 2;
}
void
set_x_3(const RKH_SMA_T *me)
{
((MySm *)(me))->x = 3;
}
void
set_y_0(const RKH_SMA_T *me)
{
((MySm *)(me))->y = 0;
}

Exit actions of "my" state machine

void
dummy_exit(const RKH_SMA_T *me)
{
(void)me;
}

Transition guard functions of "my" state machine


Branch selection functions of "my" state machine

rbool_t
y_0(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
return ((MySm *)(me))->y == 0 ? RKH_GTRUE : RKH_GFALSE;
}
rbool_t
y_1(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
return ((MySm *)(me))->y == 1 ? RKH_GTRUE : RKH_GFALSE;
}
rbool_t
y_2(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
return ((MySm *)(me))->y == 2 ? RKH_GTRUE : RKH_GFALSE;
}
rbool_t
x1(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
return ((MySm *)(me))->x == 1 ? RKH_GTRUE : RKH_GFALSE;
}
rbool_t
x2_or_x3(const RKH_SMA_T *me, RKH_EVT_T *pe)
{
(void)pe;
return (((MySm *)(me))->x == 2 || ((MySm *)(me))->x == 3) ?
}


Prev: Defining the state machine's objects
Next: Include files