1 #ifndef TRC_MY_EXTENSION_H 2 #define TRC_MY_EXTENSION_H 3 4 #include <trcRecorder.h> 5 6 /* This define enables or disables the extension. This should be in a config */ 7 #define MY_EXTENSION_ENABLED 1 8 9 /* This check can enable/disable the entire extension */ 10 #if (MY_EXTENSION_ENABLED == 1) 11 12 /* extern declaration for xMyExtension declared in MyExtension.c */ 13 extern TraceExtensionHandle_t xMyExtension; 14 15 /* This information is used to set up the extension and is also used to indicate how to find the XML configuration file. Proper XML name for this example is "MyExtension-v1.2.3.xml" */ 16 #define MY_EXTENSION_NAME "MyExtension" 17 #define MY_EXTENSION_VERSION_MAJOR 1 18 #define MY_EXTENSION_VERSION_MINOR 2 19 #define MY_EXTENSION_VERSION_PATCH 3 20 #define MY_EXTENSION_EVENT_COUNT 4 21 22 /* Macro that enables the extension and initializes xMyExtension */ 23 #define xMyExtensionEnable() (xTraceExtensionCreate(MY_EXTENSION_NAME, MY_EXTENSION_VERSION_MAJOR, MY_EXTENSION_VERSION_MINOR, MY_EXTENSION_VERSION_PATCH, MY_EXTENSION_EVENT_COUNT, &xMyExtension)) 24 25 /* Local event IDs up to (MY_EXTENSION_EVENT_COUNT - 1). You get the global event ID by calling xTraceExtensionGetEventId(...) and passing the extension handle and the local event ID as parameters */ 26 #define MY_EVENT_A 0 27 #define MY_EVENT_B 1 28 #define MY_EVENT_C 2 29 #define MY_EVENT_D 3 30 31 /* Trace point examples */ 32 33 /* First undefine any previous definitions */ 34 #undef MY_TRACE_POINT_A 35 /* This stores a trace event without any parameters. Retrieve the Extension event ID by calling xTraceExtensionGetEventId() using xMyExtension and the event's local ID */ 36 #define MY_TRACE_POINT_A() prvTraceStoreEvent_None(xTraceExtensionGetEventId(xMyExtension, MY_EVENT_A)) 37 38 #undef MY_TRACE_POINT_B 39 /* This stores a trace event with a numeric parameter. Retrieve the Extension event ID by calling xTraceExtensionGetEventId() using xMyExtension and the event's local ID */ 40 #define MY_TRACE_POINT_B() prvTraceStoreEvent_Param(xTraceExtensionGetEventId(xMyExtension, MY_EVENT_B), 1) 41 42 #undef MY_TRACE_POINT_C 43 /* This stores a trace event with a handle (here we use xMyExtension just as an example). Retrieve the Extension event ID by calling xTraceExtensionGetEventId() using xMyExtension and the event's local ID */ 44 #define MY_TRACE_POINT_C() prvTraceStoreEvent_Handle(xTraceExtensionGetEventId(xMyExtension, MY_EVENT_C), xMyExtension) 45 46 #undef MY_TRACE_POINT_D 47 /* This stores a trace event with a handle and a numeric parameter (here we use xMyExtension just as an example). Retrieve the Extension event ID by calling xTraceExtensionGetEventId() using xMyExtension and the event's local ID */ 48 #define MY_TRACE_POINT_D() prvTraceStoreEvent_HandleParam(xTraceExtensionGetEventId(xMyExtension, MY_EVENT_D), xMyExtension, 1) 49 50 #else 51 52 /* Extension disabled */ 53 #define xMyExtensionEnable() 54 55 #endif 56 57 #endif 58