RKH
RKHTmEvt Struct Reference

It defines a time event that occurs at a specific duration. More...

#include <rkhtmr.h>

Data Fields

RKH_TMR_T tmr
  More...
 

Detailed Description

It defines a time event that occurs at a specific duration.

#define SYNC_TIME RKH_TIME_MS(100)
...
static RKHTmEvt tmSync;
...
void
powerOn(ActiveObject *const me)
{
RKH_SET_STATIC_EVENT(&tmSync, Sync);
RKH_TMR_INIT(&tmSync.tmr,
RKH_UPCAST(RKH_EVT_T, &tmSync),
NULL);
RKH_TMR_ONESHOT(&tmSync.tmr,
SYNC_TIME);
}
#define RKH_UPCAST(BaseType_, me_)
Convert a pointer to a base-class.
Definition: rkhfwk_cast.h:74
#define RKH_SET_STATIC_EVENT(ev_obj, ev_sig)
This macro initialize an event e with es signal and establishes it as one static event.
#define RKH_TMR_INIT(t_, e_, th_)
Initializes the previously allocated timer structure RKH_TMR_T.
Definition: rkhtmr.h:143
#define RKH_TMR_ONESHOT(t, sma, itick)
Start a timer as one-shot timer.
Definition: rkhtmr.h:187
Represents events without parameters.
Definition: rkhevt.h:170
Describes the SMA (active object in UML).
Definition: rkhsma.h:772
It defines a time event that occurs at a specific duration.
Definition: rkhtmr.h:409
RKH_TMR_T tmr
Definition: rkhtmr.h:411

The 'tmSync' should be used like a transition's trigger to support the UML's time event 'after SYNC_TIME':

RKH_CREATE_BASIC_STATE(s1, powerOn, powerOff, RKH_ROOT, NULL);
RKH_TRREG(Sync, NULL, NULL, &s0), // 'Sync' signal enables this
// transition to 's0' state
// It is equivalent to
// 'after SYNC_TIME' UML's TimeEvent
#define RKH_CREATE_BASIC_STATE(name, en, ex, parent, prepro)
This macro creates a basic state.
Definition: rkhsm.h:277
#define RKH_CREATE_TRANS_TABLE(name)
This macro creates a state transition table.
Definition: rkhsm.h:777
#define RKH_END_TRANS_TABLE
This macro is used to terminate a state transition table. This table have the general structure shown...
Definition: rkhsm.h:894
#define RKH_TRREG(evt_, guard_, effect_, target_)
This macro defines a regular state transition.
Definition: rkhsm.h:811
#define RKH_ROOT
This macro indicates the root state of a state machine.
Definition: rkhsm.h:1019

Definition at line 408 of file rkhtmr.h.

Field Documentation

◆ tmr

RKH_TMR_T tmr

Base structure

Definition at line 411 of file rkhtmr.h.


The documentation for this struct was generated from the following file: