QSpy shows Sig=NULL if Q_EVT_CTOR is used
Real-Time Event Frameworks based on active objects & state machines
Brought to you by:
quantum-leaps
In case the option Q_EVT_CTOR is used, the macros Q_NEW and Q_NEW_X (qf.hpp (github.com)) call QF::newX_ with the sig argument set to 0.
This causes QS_SIG_PRE_ (qf_dyn.pp (github.com)) to be called with 0. As a result, QSpy is showing Sig=Nullon EV_NEW, instead of the correct sig value.
Anonymous
In case you define
Q_EVT_CTORmacro (perhaps in theqf_port.hpp), you also have to define the constructors for all your event classes. These event constructors must necessarily call the base-class constructorQEvt(sig), which sets the event signal.But this happens only after the event is allocated, so during the allocation the
sigparameter is not set yet and therefore the QS software trace reports 0.The fix for this issue is quite simple and requires only slight modification of the macros
Q_NEW()andQ_NEW_X()(as well as FreeRTOS "specials"Q_NEW_FROM_ISR()andQ_NEW_X_FROM_ISR()). The fix will be implemented in QP/C++ 7.2.0.--MMS
Fixed in QP/C/C++ 7.2.0.
--MMS