Event Trigger framework

The aim of the event trigger framework is to be able to log events and their payloads synchronously. Thus, event triggers are closely related to the Logging Framework, which logs data asynchronously. One key use-case of the event trigger framework is to analyze different state estimators. For each measurement that is pushed into the current state estimator, an event with the appropriate payload containing the measurement can be stored for later analysis.

Add Event Triggers in the Firmware

In order to add a new event trigger named myEvent with a payload of two variables, you have to add the following near the top of your *.c file:

#include "eventtrigger.h"

// declares eventTrigger_myEvent and eventTrigger_myEvent_payload
EVENTTRIGGER(myEvent, uint8, var1, float, var2)


The EVENTTRIGGER macro is variadic, i.e. it can take a varying number of arguments. It is also valid to have a event trigger without any payload. Internally, the macro generates code that declares several static variables. Details can be found in eventtrigger.h.

Once the event trigger is defined, it can be triggered anywhere in the source code of the same *.c file:

// set the payload