Go to the source code of this file.
Classes | |
| struct | QEvent |
| QEvent base class. More... | |
Defines | |
| #define | Q_ROM_BYTE(rom_var_) (rom_var_) |
| Macro to specify compiler-specific directive for placing a constant object in ROM. | |
| #define | Q_SIGNAL_SIZE 1 |
| The size (in bytes) of the signal of an event. Valid values: 1, 2, or 4; default 1. | |
| #define | Q_DIM(array_) (sizeof(array_) / sizeof(array_[0])) |
Typedefs | |
| typedef uint8_t | QSignal |
| QSignal represents the signal of an event. | |
This header file must be included, perhaps indirectly, in all modules (*.cpp files) that use any component of QP/C++ (such as QEP, QF, or QK).
Definition in file qevent.h.
| #define Q_DIM | ( | array_ | ) | (sizeof(array_) / sizeof(array_[0])) |
helper macro to calculate static dimension of a 1-dim array array_
Definition at line 137 of file qevent.h.
Referenced by QF::poolInit(), and QF::publish().
| #define Q_ROM_BYTE | ( | rom_var_ | ) | (rom_var_) |
Macro to specify compiler-specific directive for placing a constant object in ROM.
Many compilers for Harvard-architecture MCUs provide non-stanard extensions to support placement of objects in different memories. In order to conserve the precious RAM, QP uses the Q_ROM macro for all constant objects that can be allocated in ROM.
To override the following empty definition, you need to define the Q_ROM macro in the qep_port.h header file. Some examples of valid Q_ROM macro definitions are: __code (IAR 8051 compiler), code (Keil Cx51 compiler), PROGMEM (gcc for AVR), __flash (IAR for AVR). Macro to specify compiler-specific directive for accessing a constant object in ROM.
Many compilers for MCUs provide different size pointers for accessing objects in various memories. Constant objects allocated in ROM (see Q_ROM macro) often mandate the use of specific-size pointers (e.g., far pointers) to get access to ROM objects. The macro Q_ROM_VAR specifies the kind of the pointer to be used to access the ROM objects.
To override the following empty definition, you need to define the Q_ROM_VAR macro in the qep_port.h header file. An example of valid Q_ROM_VAR macro definition is: __far (Freescale HC(S)08 compiler). Macro to access a byte allocated in ROM
Some compilers for Harvard-architecture MCUs, such as gcc for AVR, do not generate correct code for accessing data allocated in the program space (ROM). The workaround for such compilers is to explictly add assembly code to access each data element allocated in the program space. The macro Q_ROM_BYTE() retrieves a byte from the given ROM address.
The Q_ROM_BYTE() macro should be defined for the compilers that cannot handle correctly data allocated in ROM (such as the gcc). If the macro is left undefined, the default definition simply returns the argument and lets the compiler generate the correct code.
Definition at line 84 of file qevent.h.
Referenced by QPSet64::findMax(), QPSet8::findMax(), QPSet64::hasElement(), QPSet8::hasElement(), QPSet64::insert(), QPSet8::insert(), QF::publish(), QPSet64::remove(), QPSet8::remove(), QS::str_ROM(), QS::str_ROM_(), QActive::subscribe(), QActive::unsubscribe(), and QActive::unsubscribeAll().
| #define Q_SIGNAL_SIZE 1 |
The size (in bytes) of the signal of an event. Valid values: 1, 2, or 4; default 1.
This macro can be defined in the QEP port file (qep_port.h) to configure the QSignal type. When the macro is not defined, the default of 1 byte is chosen.
QSignal represents the signal of an event.
The relationship between an event and a signal is as follows. A signal in UML is the specification of an asynchronous stimulus that triggers reactions [UML document ptc/03-08-02], and as such is an essential part of an event. (The signal conveys the type of the occurrence-what happened?) However, an event can also contain additional quantitative information about the occurrence in form of event parameters. Please refer to the document Brief Introduction to UML State Machines) for more information about state machine concepts.
1.5.4