|
RKH
|
Describes the SMA (active object in UML). More...
#include <rkhsma.h>
Data Fields | |
| RKH_SM_T | sm |
| State machine. | |
| RKH_EQ_TYPE | equeue |
| Virtual pointer. | |
| rbool_t | running |
| The Boolean loop variable determining if the thread routine of the SMA is running. | |
Describes the SMA (active object in UML).
This structure resides in RAM because its members are dinamically updated by RKH (context of state machine). The RKH_SM_T::romrkh member points to RKH_ROM_T structure, allocated in ROM, to reduce the size of RAM consume. The key parameters of a state machine are allocated within. Therefore cannot be modified in runtime.
RKH_SMA_T is not intended to be instantiated directly, but rather serves as the base structure for derivation of active objects in the application code. The following example illustrates how to derive an active object from RKH_SMA_T. Please note that the RKH_SMA_T member ao is defined as the FIRST member of the derived struct.
Example:
| RKH_EQ_TYPE equeue |
Virtual pointer.
OS-dependent thread of control of the active object.
Frequently, the active object has its own task processing loop that waits for the signal to be posted, and when it is, loops to remove and process all events that are currently queued. The RKH_SMA_POST_FIFO() macro enqueues an event and signals the OS that an event has arrived. In this case, os_signal holds the OS object used to signal that an event has been queued. This data might be used in various ways, depending on the RKH port. In some ports it's used to store the thread handler.
Event queue of the SMA (a.k.a Active Object).