70 #if ((RKH_CFGPORT_NATIVE_EQUEUE_EN == RKH_ENABLED) && \
71 (RKH_EN_DOXYGEN == RKH_DISABLED))
73 #define RKH_EQ_TYPE RKH_QUEUE_T
77 #define RKH_SMA_NAME(smaName_) s_##smaName_
85 #define RKH_SMA_ACCESS_STATE(me_) \
86 ((RKH_SM_T *)me_)->state
88 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
96 #define RKH_SMA_ACCESS_CONST(me_, member_) \
97 ((RKH_SM_T *)me_)->romrkh->member_
106 #define RKH_SMA_ACCESS_CONST(me_, member_) \
107 ((RKH_SM_T *)me_)->member_
137 #define RKH_SMA_DCLR(me_) \
138 RKH_DCLR_PTR_TYPE(RKH_SMA_T, me_)
166 #define RKH_SMA_DCLR_TYPE(type_, me_) \
167 RKH_DCLR_PTR_TYPE(type_, me_)
211 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
212 #if RKH_CFGPORT_SMA_QSTO_EN == RKH_ENABLED
213 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
214 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
215 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
216 (const RKH_EVT_T **)qSto_, \
221 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
222 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
223 (const RKH_EVT_T **)qSto_, \
229 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
230 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
231 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
232 (const RKH_EVT_T **)0, \
237 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
238 ((RKH_SMA_T *)(me_))->vptr->activate(me_, \
239 (const RKH_EVT_T **)0, \
246 #if RKH_CFGPORT_SMA_QSTO_EN == RKH_ENABLED
247 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
248 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
249 rkh_sma_activate(me_, \
250 (const RKH_EVT_T **)qSto_, \
255 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
256 rkh_sma_activate(me_, \
257 (const RKH_EVT_T **)qSto_, \
263 #if RKH_CFGPORT_SMA_STK_EN == RKH_ENABLED
264 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
265 rkh_sma_activate(me_, \
266 (const RKH_EVT_T **)0, \
271 #define RKH_SMA_ACTIVATE(me_, qSto_, qStoSize, stkSto_, stkSize_) \
272 rkh_sma_activate(me_, \
273 (const RKH_EVT_T **)0, \
348 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
349 #define RKH_SMA_CREATE(type, name, prio, ppty, initialState, \
350 initialAction, initialEvt) \
351 RKH_SM_CONST_CREATE(name, prio, ppty, initialState, initialAction, \
353 static type RKH_SMA_NAME(name) = MKSMA(&RKH_SM_CONST_NAME(name), \
356 #define RKH_SMA_CREATE(type, name, prio, ppty, initialState, \
357 initialAction, initialEvt) \
358 static type RKH_SMA_NAME(name) = MKSMA(name, \
366 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
367 #define RKH_SMA_INIT(me, prio, ppty, initialState, initialAction, \
370 #define RKH_SMA_INIT(me, prio, ppty, initialState, initialAction, \
372 MKRT_SM(me, me, prio, ppty, initialState, initialAction, initialEvt)
375 #if RKH_CFG_SMA_SM_CONST_EN == RKH_ENABLED
376 #define RKH_SMA_GET_OBJ(type, me)
378 #define RKH_SMA_GET_OBJ(type, me) \
379 (type *)&RKH_SMA_NAME(me)
391 #define RKH_SMA_DEF_PTR(me_) \
392 RKH_SMA_T *const me_ = (RKH_SMA_T *)&RKH_SMA_NAME(me_)
408 #define RKH_SMA_DEF_PTR_TYPE(type, me_) \
409 type *const me_ = (type *)&RKH_SMA_NAME(me_)
441 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
442 #if defined(RKH_USE_TRC_SENDER)
443 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
444 ((RKH_SMA_T *)(me_))->vptr->post_fifo((me_), (e_), (sender_))
446 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
447 ((RKH_SMA_T *)(me_))->vptr->post_fifo((me_), (e_))
450 #if defined(RKH_USE_TRC_SENDER)
451 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
452 rkh_sma_post_fifo((me_), (e_), (sender_))
454 #define RKH_SMA_POST_FIFO(me_, e_, sender_) \
455 rkh_sma_post_fifo((me_), (e_))
489 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
490 #if defined(RKH_USE_TRC_SENDER)
491 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
492 ((RKH_SMA_T *)(me_))->vptr->post_lifo((me_), (e_), (sender_))
494 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
495 ((RKH_SMA_T *)(me_))->vptr->post_lifo((me_), (e_))
498 #if defined(RKH_USE_TRC_SENDER)
499 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
500 rkh_sma_post_lifo((me_), (e_), (sender_))
502 #define RKH_SMA_POST_LIFO(me_, e_, sender_) \
503 rkh_sma_post_lifo((me_), (e_))
538 #define RKH_ARRAY_SMA_DCLR(_arr, _num) \
539 extern RKH_SMA_T * const *_arr[_num]
573 #define RKH_ARRAY_SMA_DCLR_TYPE(type_, array_, num_) \
574 extern type_ * const * array_[num_]
599 #define RKH_ARRAY_SMA_CREATE(_arr, _num) \
600 RKH_SMA_T * const *_arr[_num] =
626 #define RKH_ARRAY_SMA_CREATE_TYPE(type_, array_, num_) \
627 type_ * const * array_[num_] =
656 #define RKH_ARRAY_SMA(_arr, _ix) *_arr[_ix]
658 #if R_TRC_AO_NAME_EN == RKH_ENABLED
668 #define RKH_GET_AO_NAME(ao) RKH_SMA_ACCESS_CONST(ao, name)
670 #define RKH_GET_AO_NAME(ao) noname
681 #define RKH_GET_SMA(_prio) \
682 rkh_sptbl[(rui8_t)(_prio)]
690 #define RKH_GET_PRIO(_ao) \
691 (rui8_t)(RKH_SMA_ACCESS_CONST(_ao, prio))
760 #if RKH_CFG_SMA_VFUNCT_EN == RKH_ENABLED
781 #if RKH_CFGPORT_SMA_THREAD_EN == RKH_ENABLED
803 #if RKH_CFGPORT_SMA_THREAD_DATA_EN == RKH_ENABLED
827 #if RKH_CFG_SMA_GET_INFO_EN == RKH_ENABLED
835 void *stkSto, rui32_t stkSize);
841 #if defined(RKH_USE_TRC_SENDER)
843 const void *
const sender);
849 #if defined(RKH_USE_TRC_SENDER)
851 const void *
const sender);
997 #if defined(RKH_USE_TRC_SENDER)
1030 const void *
const sender);
1035 #if defined(RKH_USE_TRC_SENDER)
1069 const void *
const sender);
rbool_t running
The Boolean loop variable determining if the thread routine of the SMA is running.
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...
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...
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(* 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...
Describes the SMA (active object in UML).
#define RKH_THREAD_TYPE
Frequently, the active object has its own task processing loop that waits for the signal to be posted...
rui8_t RKH_QUENE_T
This data type defines the maximum number of elements that any queue can contain. ...
Represents events without parameters.
Defines the data structure used to maintain information about the queue.
RKH_SMA_T * rkh_sptbl[RKH_CFG_FWK_MAX_SMA]
Priority arranged table of registered SMA.
RKH_EQ_TYPE equeue
Event queue of the SMA (a.k.a Active Object).
void rkh_sma_defer(RKH_QUEUE_T *q, const RKH_EVT_T *e)
Defer an event to a given separate event queue.
RKH_SM_T sm
State machine.
void(* RKHTask)(RKH_SMA_T *me, void *arg)
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_unregister(RKH_SMA_T *me)
Removes the SMA as known as active object from the priority table, and thus from the framework...
const RKHSmaVtbl rkhSmaVtbl
void rkh_sma_register(RKH_SMA_T *me)
Registers a state machine application (SMA) as known as active object into the framework, which implies to store a pointer to the SMA in the priority table.
Describes the state machine.
Virtual table for the RKH_SMA_T structure.
RKH_THREAD_TYPE thread
Virtual pointer.
void(* RKHPostLifo)(RKH_SMA_T *me, const RKH_EVT_T *e, const void *const sender)
RKH_SMAI_T sinfo
Performance information. This member is optional, thus it could be declared as NULL or eliminated in ...
RKH_EVT_T * rkh_sma_recall(RKH_SMA_T *me, RKH_QUEUE_T *q)
Recall a deferred event from a given event queue.
Defines the data structure into which the collected performance information for state machine is stor...
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...
void rkh_sma_terminate(RKH_SMA_T *me)
Terminate a state machine application (SMA) as known as active object.
#define RKH_OSSIGNAL_TYPE
The os_signal member of RKH_SMA_T is necessary when the underlying OS does not provide an adequate qu...
RKH_OSSIGNAL_TYPE os_signal
OS-dependent object used to signal that an event has been queued.
#define RKH_CFG_FWK_MAX_SMA
Specify the maximum number of state machine applications (SMA) to be used by the application (can be ...
void rkh_sma_clear_info(RKH_SMA_T *me)
Clear performance information for a particular state machine application (SMA) as known as active obj...
RKHTask task
Virtual function to control the execution of the AO (thread task).
Specifies the interface of the state-machine manager.
void(* RKHActivate)(RKH_SMA_T *me, const RKH_EVT_T **qSto, RKH_QUENE_T qSize, void *stkSto, rui32_t stkSize)
#define RKH_EQ_TYPE
Defines the data type of the event queue for active objects. The event queue can be implemented with ...
Specifies the interface of the queue services.