72 #if ((RKH_CFGPORT_NATIVE_EQUEUE_EN == RKH_ENABLED) && \
73 (RKH_EN_DOXYGEN == RKH_DISABLED))
75 #define RKH_EQ_TYPE RKH_QUEUE_T
79 #define RKH_SMA_NAME(smaName_) s_##smaName_
87 #define RKH_SMA_ACCESS_STATE(me_) \
88 ((RKH_SM_T *)me_)->state
90 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
98 #define RKH_SMA_ACCESS_CONST(me_, member_) \
99 ((RKH_SM_T *)me_)->romrkh->member_
108 #define RKH_SMA_ACCESS_CONST(me_, member_) \
109 ((RKH_SM_T *)me_)->member_
139 #define RKH_SMA_DCLR(me_) \
140 RKH_DCLR_PTR_TYPE(RKH_SMA_T, me_)
168 #define RKH_SMA_DCLR_TYPE(type_, me_) \
169 RKH_DCLR_PTR_TYPE(type_, me_)
213 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
214 #if RKH_CFGPORT_SMA_QSTO_EN == RKH_ENABLED
215 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
216 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
217 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
218 (const RKH_EVT_T **)qSto_, \
223 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
224 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
225 (const RKH_EVT_T **)qSto_, \
231 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
232 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
233 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
234 (const RKH_EVT_T **)0, \
239 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
240 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
241 (const RKH_EVT_T **)0, \
248 #if RKH_CFGPORT_SMA_QSTO_EN == RKH_ENABLED
249 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
250 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
251 rkh_sma_activate(me_, \
252 (const RKH_EVT_T **)qSto_, \
257 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
258 rkh_sma_activate(me_, \
259 (const RKH_EVT_T **)qSto_, \
265 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
266 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
267 rkh_sma_activate(me_, \
268 (const RKH_EVT_T **)0, \
273 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
274 rkh_sma_activate(me_, \
275 (const RKH_EVT_T **)0, \
347 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
348 #define RKH_SMA_CREATE(type, name, prio, ppty, initialState, \
349 initialAction, initialEvt) \
350 static RKH_SM_CONST_CREATE(name, prio, ppty, initialState, \
351 initialAction, initialEvt); \
352 static type RKH_SMA_NAME(name) = MKSMA(&RKH_SM_CONST_NAME(name), \
355 #define RKH_SMA_CREATE(type, name, prio, ppty, initialState, \
356 initialAction, initialEvt) \
357 static type RKH_SMA_NAME(name) = MKSMA(name, \
365 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
366 #define RKH_SMA_INIT(me, prio, ppty, initialState, initialAction, \
369 #define RKH_SMA_INIT(me, prio, ppty, initialState, initialAction, \
371 MKRT_SM(me, me, prio, ppty, initialState, initialAction, initialEvt)
374 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
375 #define RKH_SMA_GET_OBJ(type, me)
377 #define RKH_SMA_GET_OBJ(type, me) \
378 (type *)&RKH_SMA_NAME(me)
390 #define RKH_SMA_DEF_PTR(me_) \
391 RKH_SMA_T *const me_ = (RKH_SMA_T *)&RKH_SMA_NAME(me_)
407 #define RKH_SMA_DEF_PTR_TYPE(type, me_) \
408 type *const me_ = (type *)&RKH_SMA_NAME(me_)
440 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
441 #if defined(RKH_USE_TRC_SENDER)
442 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
443 ((RKH_SMA_T *)(me_))->vptr->post_fifo((me_), (e_), (sender_))
445 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
446 ((RKH_SMA_T *)(me_))->vptr->post_fifo((me_), (e_))
449 #if defined(RKH_USE_TRC_SENDER)
450 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
451 rkh_sma_post_fifo((me_), (e_), (sender_))
453 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
454 rkh_sma_post_fifo((me_), (e_))
488 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
489 #if defined(RKH_USE_TRC_SENDER)
490 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
491 ((RKH_SMA_T *)(me_))->vptr->post_lifo((me_), (e_), (sender_))
493 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
494 ((RKH_SMA_T *)(me_))->vptr->post_lifo((me_), (e_))
497 #if defined(RKH_USE_TRC_SENDER)
498 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
499 rkh_sma_post_lifo((me_), (e_), (sender_))
501 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
502 rkh_sma_post_lifo((me_), (e_))
522 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
523 #define RKH_SMA_DISPATCH(me_, arg_) \
524 ((RKH_SMA_T *)(me_))->vptr->task((me_), (arg_))
526 #define RKH_SMA_DISPATCH(me_, arg_) \
527 rkh_sma_dispatch((me_), (arg_))
561 #define RKH_ARRAY_SMA_DCLR(_arr, _num) \
562 extern RKH_SMA_T * const *_arr[_num]
596 #define RKH_ARRAY_SMA_DCLR_TYPE(type_, array_, num_) \
597 extern type_ * const * array_[num_]
622 #define RKH_ARRAY_SMA_CREATE(_arr, _num) \
623 RKH_SMA_T * const *_arr[_num] =
649 #define RKH_ARRAY_SMA_CREATE_TYPE(type_, array_, num_) \
650 type_ * const * array_[num_] =
679 #define RKH_ARRAY_SMA(_arr, _ix) *_arr[_ix]
681 #if R_TRC_AO_NAME_EN == RKH_ENABLED
691 #define RKH_GET_AO_NAME(ao) RKH_SMA_ACCESS_CONST(ao, name)
693 #define RKH_GET_AO_NAME(ao) noname
704 #define RKH_GET_SMA(_prio) \
705 rkh_sptbl[(rui8_t)(_prio)]
713 #define RKH_GET_PRIO(_ao) \
714 (rui8_t)(RKH_SMA_ACCESS_CONST(_ao, prio))
783 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
804 #if RKH_CFGPORT_SMA_THREAD_EN == RKH_ENABLED
826 #if RKH_CFGPORT_SMA_THREAD_DATA_EN == RKH_ENABLED
850 #if RKH_CFG_SMA_GET_INFO_EN == RKH_ENABLED
858 void *stkSto, rui32_t stkSize);
864 #if defined(RKH_USE_TRC_SENDER)
866 const void *
const sender);
872 #if defined(RKH_USE_TRC_SENDER)
874 const void *
const sender);
1024 #if defined(RKH_USE_TRC_SENDER)
1057 const void *
const sender);
1062 #if defined(RKH_USE_TRC_SENDER)
1096 const void *
const sender);
void rkh_sma_dispatch(RKH_SMA_T *me, void *arg)
For cooperative scheduling policy, this function is used to dispatch the event to the active object b...
void rkh_sma_post_lifo(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
Send an event to a state machine application (SMA) as known as active object through a queue using th...
void rkh_sma_terminate(RKH_SMA_T *me)
Terminate a state machine application (SMA) as known as active object.
void rkh_sma_post_fifo(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
Send an event to a state machine application (SMA) as known as active object through a queue using th...
RKH_EVT_T * rkh_sma_get(RKH_SMA_T *me)
Get an event from the event queue of an state machine application (SMA) as known as active object....
void rkh_sma_activate(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_QUENE_T qSize, void *stkSto, rui32_t stkSize)
Initializes and activates a previously created state machine application (SMA) as known as active obj...
#define RKH_CFG_FWK_MAX_SMA
Specify the maximum number of state machine applications (SMA) to be used by the application (can be ...
RKH_SMA_T * rkh_sptbl[RKH_CFG_FWK_MAX_SMA]
Priority arranged table of registered SMA.
#define RKH_THREAD_TYPE
Frequently, the active object has its own task processing loop that waits for the signal to be posted...
#define RKH_EQ_TYPE
Defines the data type of the event queue for active objects. The event queue can be implemented with ...
#define RKH_OSSIGNAL_TYPE
The os_signal member of RKH_SMA_T is necessary when the underlying OS does not provide an adequate qu...
Specifies the interface of the queue services.
rui8_t RKH_QUENE_T
This data type defines the maximum number of elements that any queue can contain.
Specifies the interface of the state-machine manager.
void rkh_sma_register(RKH_SMA_T *me)
Registers a state machine application (SMA) as known as active object into the framework,...
void rkh_sma_clear_info(RKH_SMA_T *me)
Clear performance information for a particular state machine application (SMA) as known as active obj...
void(* RKHTask)(RKH_SMA_T *me, void *arg)
RKH_EVT_T * rkh_sma_recall(RKH_SMA_T *me, RKH_QUEUE_T *q)
Recall a deferred event from a given event queue.
void rkh_sma_defer(RKH_QUEUE_T *q, const RKH_EVT_T *e)
Defer an event to a given separate event queue.
const RKHSmaVtbl rkhSmaVtbl
void rkh_sma_get_info(RKH_SMA_T *me, RKH_SMAI_T *psi)
Retrieves performance information for a particular state machine application (SMA) as known as active...
void(* RKHActivate)(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_QUENE_T qSize, void *stkSto, rui32_t stkSize)
void rkh_sma_unregister(RKH_SMA_T *me)
Removes the SMA as known as active object from the priority table, and thus from the framework,...
void(* RKHPostLifo)(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
void(* RKHPostFifo)(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
void rkh_sma_ctor(RKH_SMA_T *me, const RKHSmaVtbl *vtbl)
Initializes the virtual table of the active object instance and calls the constructor operation of it...
Represents events without parameters.
Defines the data structure used to maintain information about the queue.
Describes the state machine.
Describes the SMA (active object in UML).
RKH_SM_T sm
State machine.
RKH_OSSIGNAL_TYPE os_signal
OS-dependent object used to signal that an event has been queued.
RKH_SMAI_T sinfo
Performance information. This member is optional, thus it could be declared as NULL or eliminated in ...
rbool_t running
The Boolean loop variable determining if the thread routine of the SMA is running.
RKH_THREAD_TYPE thread
Virtual pointer.
RKH_EQ_TYPE equeue
Event queue of the SMA (a.k.a Active Object).
Defines the data structure into which the collected performance information for state machine is stor...
Virtual table for the RKH_SMA_T structure.
RKHTask task
Virtual function to control the execution of the AO (thread task).