]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-Plus-Trace/trcSnapshotRecorder.c
Update trace recorder code to the latest.
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-Trace / trcSnapshotRecorder.c
index 76a1345f594cf6b7ddb5470969fd9b79de75df61..9eec9d2edd61f86211c72cc5a67149f56a43c389 100644 (file)
@@ -1,5 +1,5 @@
 /*******************************************************************************\r
- * Trace Recorder Library for Tracealyzer v4.1.1\r
+ * Trace Recorder Library for Tracealyzer v4.1.5\r
  * Percepio AB, www.percepio.com\r
  *\r
  * trcSnapshotRecorder.c\r
@@ -7,7 +7,7 @@
  * The generic core of the trace recorder's snapshot mode.\r
  *\r
  * Terms of Use\r
- * This file is part of the trace recorder library (RECORDER), which is the \r
+ * This file is part of the trace recorder library (RECORDER), which is the\r
  * intellectual property of Percepio AB (PERCEPIO) and provided under a\r
  * license as follows.\r
  * The RECORDER may be used free of charge for the purpose of recording data\r
  * You may distribute the RECORDER in its original source code form, assuming\r
  * this text (terms of use, disclaimer, copyright notice) is unchanged. You are\r
  * allowed to distribute the RECORDER with minor modifications intended for\r
- * configuration or porting of the RECORDER, e.g., to allow using it on a \r
+ * configuration or porting of the RECORDER, e.g., to allow using it on a\r
  * specific processor, processor family or with a specific communication\r
  * interface. Any such modifications should be documented directly below\r
- * this comment block.  \r
+ * this comment block.\r
  *\r
  * Disclaimer\r
  * The RECORDER is being delivered to you AS IS and PERCEPIO makes no warranty\r
- * as to its use or performance. PERCEPIO does not and cannot warrant the \r
+ * as to its use or performance. PERCEPIO does not and cannot warrant the\r
  * performance or results you may obtain by using the RECORDER or documentation.\r
  * PERCEPIO make no warranties, express or implied, as to noninfringement of\r
  * third party rights, merchantability, or fitness for any particular purpose.\r
@@ -107,9 +107,9 @@ extern traceHandle handle_of_last_logged_task;
 \r
 /*************** Private Functions *******************************************/\r
 static void prvStrncpy(char* dst, const char* src, uint32_t maxLength);\r
-static uint8_t prvTraceGetObjectState(uint8_t objectclass, traceHandle id); \r
-static void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength); \r
-static void* prvTraceNextFreeEventBufferSlot(void); \r
+static uint8_t prvTraceGetObjectState(uint8_t objectclass, traceHandle id);\r
+static void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength);\r
+static void* prvTraceNextFreeEventBufferSlot(void);\r
 static uint16_t prvTraceGetDTS(uint16_t param_maxDTS);\r
 static traceString prvTraceOpenSymbol(const char* name, traceString userEventChannel);\r
 static void prvTraceUpdateCounters(void);\r
@@ -136,7 +136,7 @@ static traceString prvTraceLookupSymbolTableEntry(const char* name,
 void prvTraceIncreaseISRActive(void);\r
 void prvTraceDecreaseISRActive(void);\r
 #endif /*(TRC_CFG_INCLUDE_ISR_TRACING == 0)*/\r
-                                                                                \r
+\r
 #if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1)\r
 static uint8_t prvTraceGet8BitHandle(traceHandle handle);\r
 #else\r
@@ -204,19 +204,19 @@ void prvTraceError(const char* msg);
 * Initializes and optionally starts the trace, depending on the start option.\r
 * To use the trace recorder, the startup must call vTraceEnable before any RTOS\r
 * calls are made (including "create" calls). Three start options are provided:\r
-* \r
-* TRC_START: Starts the tracing directly. In snapshot mode this allows for \r
+*\r
+* TRC_START: Starts the tracing directly. In snapshot mode this allows for\r
 * starting the trace at any point in your code, assuming vTraceEnable(TRC_INIT)\r
 * has been called in the startup.\r
 * Can also be used for streaming without Tracealyzer control, e.g. to a local\r
 * flash file system (assuming such a "stream port", see trcStreamingPort.h).\r
-* \r
+*\r
 * TRC_INIT: Initializes the trace recorder, but does not start the tracing.\r
 * In snapshot mode, this must be followed by a vTraceEnable(TRC_START) sometime\r
 * later.\r
 *\r
 * Usage examples, in snapshot mode:\r
-* \r
+*\r
 * Snapshot trace, from startup:\r
 *      <board init>\r
 *      vTraceEnable(TRC_START);\r
@@ -228,14 +228,14 @@ void prvTraceError(const char* msg);
 *      <RTOS init>\r
 *      ...\r
 *      vTraceEnable(TRC_START); // e.g., in task context, at some relevant event\r
-* \r
+*\r
 *\r
 * Note: See other implementation of vTraceEnable in trcStreamingRecorder.c\r
 ******************************************************************************/\r
 void vTraceEnable(int startOption)\r
 {\r
        prvTraceInitTraceData();\r
-       \r
+\r
        if (startOption == TRC_START)\r
        {\r
                vTraceStart();\r
@@ -247,7 +247,7 @@ void vTraceEnable(int startOption)
        else if (startOption != TRC_INIT)\r
        {\r
                prvTraceError("Unexpected argument to vTraceEnable (snapshot mode)");\r
-       }       \r
+       }\r
 }\r
 \r
 /*******************************************************************************\r
@@ -325,7 +325,7 @@ uint32_t uiTraceStart(void)
                TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized. Use vTraceEnable() instead!", 0);\r
                return 0;\r
        }\r
-       \r
+\r
        if (RecorderDataPtr->recorderActive == 1)\r
                return 1; /* Already running */\r
 \r
@@ -553,7 +553,7 @@ void vTraceInstanceFinishedNow(void)
  * xTraceSetISRProperties\r
  *\r
  * Stores a name and priority level for an Interrupt Service Routine, to allow\r
- * for better visualization. Returns a traceHandle used by vTraceStoreISRBegin. \r
+ * for better visualization. Returns a traceHandle used by vTraceStoreISRBegin.\r
  *\r
  * Example:\r
  *      #define PRIO_ISR_TIMER1 3 // the hardware priority of the interrupt\r
@@ -569,7 +569,7 @@ void vTraceInstanceFinishedNow(void)
  ******************************************************************************/\r
  traceHandle xTraceSetISRProperties(const char* name, uint8_t priority)\r
 {\r
-       static traceHandle handle = 0;  \r
+       static traceHandle handle = 0;\r
        TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0);\r
        TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "xTraceSetISRProperties: Invalid value for handle", 0);\r
        TRACE_ASSERT(name != NULL, "xTraceSetISRProperties: name == NULL", 0);\r
@@ -578,7 +578,7 @@ void vTraceInstanceFinishedNow(void)
 \r
        prvTraceSetObjectName(TRACE_CLASS_ISR, handle, name);\r
        prvTraceSetPriorityProperty(TRACE_CLASS_ISR, handle, priority);\r
-       \r
+\r
        return handle;\r
 }\r
 \r
@@ -608,7 +608,7 @@ void vTraceStoreISRBegin(traceHandle handle)
        {\r
                /*************************************************************************\r
                * This occurs if an ISR calls a trace function, preempting a previous\r
-               * trace call that is being processed in a different ISR or task. \r
+               * trace call that is being processed in a different ISR or task.\r
                * If this occurs, there is probably a problem in the definition of the\r
                * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
                * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
@@ -620,14 +620,14 @@ void vTraceStoreISRBegin(traceHandle handle)
                return;\r
        }\r
        trcCRITICAL_SECTION_BEGIN();\r
-       \r
+\r
        if (RecorderDataPtr->recorderActive && handle_of_last_logged_task)\r
        {\r
                uint16_t dts4;\r
-               \r
-               TRACE_ASSERT(handle != 0, "vTraceStoreISRBegin: Invalid ISR handle (NULL)", TRC_UNUSED);                \r
+\r
+               TRACE_ASSERT(handle != 0, "vTraceStoreISRBegin: Invalid ISR handle (NULL)", TRC_UNUSED);\r
                TRACE_ASSERT(handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[TRACE_CLASS_ISR], "vTraceStoreISRBegin: Invalid ISR handle (> NISR)", TRC_UNUSED);\r
-               \r
+\r
                dts4 = (uint16_t)prvTraceGetDTS(0xFFFF);\r
 \r
                if (RecorderDataPtr->recorderActive) /* Need to repeat this check! */\r
@@ -663,7 +663,7 @@ void vTraceStoreISRBegin(traceHandle handle)
  * Registers the end of an Interrupt Service Routine.\r
  *\r
  * The parameter pendingISR indicates if the interrupt has requested a\r
- * task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the \r
+ * task-switch (= 1), e.g., by signaling a semaphore. Otherwise (= 0) the\r
  * interrupt is assumed to return to the previous context.\r
  *\r
  * Example:\r
@@ -684,7 +684,7 @@ void vTraceStoreISREnd(int pendingISR)
        TSEvent* ts;\r
        uint16_t dts5;\r
        uint8_t hnd8 = 0, type = 0;\r
-       \r
+\r
        TRACE_ALLOC_CRITICAL_SECTION();\r
 \r
        if (! RecorderDataPtr->recorderActive ||  ! handle_of_last_logged_task)\r
@@ -696,7 +696,7 @@ void vTraceStoreISREnd(int pendingISR)
        {\r
                /*************************************************************************\r
                * This occurs if an ISR calls a trace function, preempting a previous\r
-               * trace call that is being processed in a different ISR or task. \r
+               * trace call that is being processed in a different ISR or task.\r
                * If this occurs, there is probably a problem in the definition of the\r
                * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
                * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
@@ -707,7 +707,7 @@ void vTraceStoreISREnd(int pendingISR)
                prvTraceError("vTraceStoreISREnd - recorder busy! See code comment.");\r
                return;\r
        }\r
-       \r
+\r
        if (nISRactive == 0)\r
        {\r
                prvTraceError("Unmatched call to vTraceStoreISREnd (nISRactive == 0, expected > 0)");\r
@@ -723,7 +723,7 @@ void vTraceStoreISREnd(int pendingISR)
                type = TS_ISR_RESUME;\r
                hnd8 = prvTraceGet8BitHandle(isrstack[nISRactive - 1]); /* isrstack[nISRactive] is the handle of the ISR we're currently exiting. isrstack[nISRactive - 1] is the handle of the ISR that was executing previously. */\r
        }\r
-       else if ((isPendingContextSwitch == 0) || (prvTraceIsSchedulerSuspended()))     \r
+       else if ((isPendingContextSwitch == 0) || (prvTraceIsSchedulerSuspended()))\r
        {\r
                /* Return to interrupted task, if no context switch will occur in between. */\r
                type = TS_TASK_RESUME;\r
@@ -1081,7 +1081,7 @@ static void prvTraceClearChannelBuffer(uint32_t count)
 static void prvTraceCopyToDataBuffer(uint32_t* data, uint32_t count)\r
 {\r
        uint32_t slots;\r
-       \r
+\r
        TRACE_ASSERT(data != NULL,\r
                "prvTraceCopyToDataBuffer: data == NULL.", TRC_UNUSED);\r
        TRACE_ASSERT(count <= (TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE),\r
@@ -1137,7 +1137,7 @@ static void prvTraceUBHelper2(traceUBChannel channel, uint32_t* data, uint32_t n
 {\r
        static uint32_t old_timestamp = 0;\r
        uint32_t old_nextSlotToWrite = 0;\r
-       \r
+\r
        TRACE_ALLOC_CRITICAL_SECTION();\r
 \r
        TRACE_ASSERT((TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE) >= noOfSlots, "prvTraceUBHelper2: TRC_CFG_SEPARATE_USER_EVENT_BUFFER_SIZE is too small to handle this event.", TRC_UNUSED);\r
@@ -1189,7 +1189,7 @@ traceUBChannel xTraceRegisterUBChannel(traceString channel, traceString formatSt
 {\r
        uint8_t i;\r
        traceUBChannel retVal = 0;\r
-       \r
+\r
        TRACE_ALLOC_CRITICAL_SECTION();\r
 \r
        TRACE_ASSERT(formatStr != 0, "xTraceRegisterChannelFormat: formatStr == 0", (traceUBChannel)0);\r
@@ -1231,7 +1231,7 @@ traceUBChannel xTraceRegisterUBChannel(traceString channel, traceString formatSt
 void vTraceUBData(traceUBChannel channelPair, ...)\r
 {\r
        va_list vl;\r
-       \r
+\r
        TRACE_ASSERT(channelPair != 0, "vTraceUBData: Not a valid traceUBChannel!", TRC_UNUSED);\r
 \r
        va_start(vl, channelPair);\r
@@ -1531,7 +1531,7 @@ traceString xTraceRegisterString(const char* label)
 \r
 #if ((!defined TRC_CFG_INCLUDE_READY_EVENTS) || (TRC_CFG_INCLUDE_READY_EVENTS == 1))\r
 \r
-void prvTraceSetReadyEventsEnabled(int status) \r
+void prvTraceSetReadyEventsEnabled(int status)\r
 {\r
        readyEventsEnabled = status;\r
 }\r
@@ -1541,7 +1541,7 @@ void prvTraceSetReadyEventsEnabled(int status)
  *\r
  * This function stores a ready state for the task handle sent in as parameter.\r
  ******************************************************************************/\r
-void prvTraceStoreTaskReady(traceHandle handle) \r
+void prvTraceStoreTaskReady(traceHandle handle)\r
 {\r
        uint16_t dts3;\r
        TREvent* tr;\r
@@ -1555,11 +1555,11 @@ void prvTraceStoreTaskReady(traceHandle handle)
                placement of the trace macro. In that case, the events are ignored. */\r
                return;\r
        }\r
-       \r
+\r
        if (! readyEventsEnabled)\r
        {\r
-               /* When creating tasks, ready events are also created. If creating \r
-               a "hidden" (not traced) task, we must therefore disable recording \r
+               /* When creating tasks, ready events are also created. If creating\r
+               a "hidden" (not traced) task, we must therefore disable recording\r
                of ready events to avoid an undesired ready event... */\r
                return;\r
        }\r
@@ -1570,7 +1570,7 @@ void prvTraceStoreTaskReady(traceHandle handle)
        {\r
                /*************************************************************************\r
                * This occurs if an ISR calls a trace function, preempting a previous\r
-               * trace call that is being processed in a different ISR or task. \r
+               * trace call that is being processed in a different ISR or task.\r
                * If this occurs, there is probably a problem in the definition of the\r
                * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
                * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
@@ -1605,7 +1605,7 @@ void prvTraceStoreTaskReady(traceHandle handle)
  *\r
  * This function stores a low power state.\r
  ******************************************************************************/\r
-void prvTraceStoreLowPower(uint32_t flag) \r
+void prvTraceStoreLowPower(uint32_t flag)\r
 {\r
        uint16_t dts;\r
        LPEvent* lp;\r
@@ -1617,7 +1617,7 @@ void prvTraceStoreLowPower(uint32_t flag)
        {\r
                /*************************************************************************\r
                * This occurs if an ISR calls a trace function, preempting a previous\r
-               * trace call that is being processed in a different ISR or task. \r
+               * trace call that is being processed in a different ISR or task.\r
                * If this occurs, there is probably a problem in the definition of the\r
                * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
                * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
@@ -1671,16 +1671,16 @@ void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t signed_si
                /* Occurs in vTraceInitTraceData, if using dynamic allocation. */\r
                return;\r
        }\r
-       \r
+\r
        if (signed_size < 0)\r
                size = (uint32_t)(- signed_size);\r
        else\r
                size = (uint32_t)(signed_size);\r
 \r
        trcCRITICAL_SECTION_BEGIN();\r
-       \r
+\r
        heapMemUsage = heapMemUsage + (uint32_t)signed_size;\r
-       \r
+\r
        if (RecorderDataPtr->recorderActive)\r
        {\r
                dts1 = (uint8_t)prvTraceGetDTS(0xFF);\r
@@ -1699,7 +1699,7 @@ void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t signed_si
                                /* If the heap address range is within 16 MB, i.e., the upper 8 bits\r
                                of addresses are constant, this optimization avoids storing an extra\r
                                event record by ignoring the upper 8 bit of the address */\r
-                               addr_low = address & 0xFFFF;          \r
+                               addr_low = address & 0xFFFF;\r
                                addr_high = (address >> 16) & 0xFF;\r
                        #else\r
                                /* The whole 32 bit address is stored using a second event record\r
@@ -1715,7 +1715,7 @@ void vTraceStoreMemMangEvent(uint32_t ecode, uint32_t address, int32_t signed_si
                                ma->addr_high = addr_high;\r
                                ma->type = (uint8_t) (ecode  + 1); /* Note this! */\r
                                ms->type = (uint8_t) ecode;\r
-                               prvTraceUpdateCounters();                                       \r
+                               prvTraceUpdateCounters();\r
                                RecorderDataPtr->heapMemUsage = heapMemUsage;\r
                        }\r
                }\r
@@ -1747,7 +1747,7 @@ void prvTraceStoreKernelCall(uint32_t ecode, traceObjectClass objectClass, uint3
        {\r
                /*************************************************************************\r
                * This occurs if an ISR calls a trace function, preempting a previous\r
-               * trace call that is being processed in a different ISR or task. \r
+               * trace call that is being processed in a different ISR or task.\r
                * If this occurs, there is probably a problem in the definition of the\r
                * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
                * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
@@ -1809,7 +1809,7 @@ void prvTraceStoreKernelCallWithParam(uint32_t evtcode,
        {\r
                /*************************************************************************\r
                * This occurs if an ISR calls a trace function, preempting a previous\r
-               * trace call that is being processed in a different ISR or task. \r
+               * trace call that is being processed in a different ISR or task.\r
                * If this occurs, there is probably a problem in the definition of the\r
                * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
                * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
@@ -1899,7 +1899,7 @@ void prvTraceStoreKernelCallWithNumericParamOnly(uint32_t evtcode, uint32_t para
        {\r
                /*************************************************************************\r
                * This occurs if an ISR calls a trace function, preempting a previous\r
-               * trace call that is being processed in a different ISR or task. \r
+               * trace call that is being processed in a different ISR or task.\r
                * If this occurs, there is probably a problem in the definition of the\r
                * recorder's internal critical sections (TRACE_ENTER_CRITICAL_SECTION and\r
                * TRACE_EXIT_CRITICAL_SECTION). They must disable the RTOS tick interrupt\r
@@ -2109,13 +2109,13 @@ void prvTraceSetTaskInstanceFinished(traceHandle handle)
  ******************************************************************************/\r
 \r
 /* A set of stacks that keeps track of available object handles for each class.\r
-The stacks are empty initially, meaning that allocation of new handles will be \r
+The stacks are empty initially, meaning that allocation of new handles will be\r
 based on a counter (for each object class). Any delete operation will\r
 return the handle to the corresponding stack, for reuse on the next allocate.*/\r
 objectHandleStackType objectHandleStacks = { { 0 }, { 0 }, { 0 }, { 0 }, { 0 } };\r
 \r
-/* Initial TRC_HWTC_COUNT value, for detecting if the time-stamping source is \r
-enabled. If using the OS periodic timer for time-stamping, this might not \r
+/* Initial TRC_HWTC_COUNT value, for detecting if the time-stamping source is\r
+enabled. If using the OS periodic timer for time-stamping, this might not\r
 have been configured on the earliest events during the startup. */\r
 uint32_t init_hwtc_count;\r
 \r
@@ -2134,14 +2134,14 @@ RecorderDataType RecorderData;
 /*******************************************************************************\r
  * RecorderDataPtr\r
  *\r
- * Pointer to the main data structure, when in snapshot mode. \r
+ * Pointer to the main data structure, when in snapshot mode.\r
  ******************************************************************************/\r
 RecorderDataType* RecorderDataPtr = NULL;\r
 \r
 /* This version of the function dynamically allocates the trace data */\r
 void prvTraceInitTraceData()\r
-{      \r
-       \r
+{\r
+\r
        if (RecorderDataPtr == NULL)\r
        {\r
 #if (TRC_CFG_RECORDER_BUFFER_ALLOCATION == TRC_RECORDER_BUFFER_ALLOCATION_STATIC)\r
@@ -2169,11 +2169,11 @@ void prvTraceInitTraceData()
                        return;\r
                }\r
        }\r
-       \r
+\r
        init_hwtc_count = TRC_HWTC_COUNT;\r
-               \r
+\r
        (void)memset(RecorderDataPtr, 0, sizeof(RecorderDataType));\r
-       \r
+\r
        RecorderDataPtr->version = TRACE_KERNEL_VERSION;\r
        RecorderDataPtr->minor_version = TRACE_MINOR_VERSION;\r
        RecorderDataPtr->irq_priority_order = TRC_IRQ_PRIORITY_ORDER;\r
@@ -2218,20 +2218,20 @@ void prvTraceInitTraceData()
        /* Kernel specific initialization of the objectHandleStacks variable */\r
        vTraceInitObjectHandleStack();\r
 \r
-       \r
-       /* Finally, the 12-byte "start markers" are initialized, allowing for \r
-       Tracealyzer to find the trace data in a larger RAM dump. \r
-       \r
+\r
+       /* Finally, the 12-byte "start markers" are initialized, allowing for\r
+       Tracealyzer to find the trace data in a larger RAM dump.\r
+\r
        The start and end markers must be unique, but without proper precautions there\r
        might be a risk of accidental duplicates of the start/end markers, e.g., due to\r
        compiler optimizations.\r
-       \r
-       The below initialization of the start marker is therefore made in reverse order \r
-       and the fields are volatile to ensure this assignment order. This to avoid any \r
+\r
+       The below initialization of the start marker is therefore made in reverse order\r
+       and the fields are volatile to ensure this assignment order. This to avoid any\r
        chance of accidental duplicates of this elsewhere in memory.\r
-       \r
+\r
        Moreover, the fields are set byte-by-byte to avoid endian issues.*/\r
-       \r
+\r
        RecorderDataPtr->startmarker11 = 0xF4;\r
        RecorderDataPtr->startmarker10 = 0xF3;\r
        RecorderDataPtr->startmarker9 = 0xF2;\r
@@ -2242,8 +2242,8 @@ void prvTraceInitTraceData()
        RecorderDataPtr->startmarker4 = 0x71;\r
        RecorderDataPtr->startmarker3 = 0x04;\r
        RecorderDataPtr->startmarker2 = 0x03;\r
-       RecorderDataPtr->startmarker1 = 0x02;   \r
-       RecorderDataPtr->startmarker0 = 0x01; \r
+       RecorderDataPtr->startmarker1 = 0x02;\r
+       RecorderDataPtr->startmarker0 = 0x01;\r
 \r
        if (traceErrorMessage != NULL)\r
        {\r
@@ -2254,7 +2254,7 @@ void prvTraceInitTraceData()
        }\r
 \r
 \r
-       \r
+\r
 #ifdef TRC_PORT_SPECIFIC_INIT\r
        TRC_PORT_SPECIFIC_INIT();\r
 #endif\r
@@ -2280,15 +2280,15 @@ void* prvTraceNextFreeEventBufferSlot(void)
 \r
 uint16_t uiIndexOfObject(traceHandle objecthandle, uint8_t objectclass)\r
 {\r
-       TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+       TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
                "uiIndexOfObject: Invalid value for objectclass", 0);\r
-       TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], \r
+       TRACE_ASSERT(objecthandle > 0 && objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],\r
                "uiIndexOfObject: Invalid value for objecthandle", 0);\r
 \r
-       if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) && \r
+       if ((objectclass < TRACE_NCLASSES) && (objecthandle > 0) &&\r
                (objecthandle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass]))\r
        {\r
-               return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] + \r
+               return (uint16_t)(RecorderDataPtr->ObjectPropertyTable.StartIndexOfClass[objectclass] +\r
                        (RecorderDataPtr->ObjectPropertyTable.TotalPropertyBytesPerClass[objectclass] * (objecthandle-1)));\r
        }\r
 \r
@@ -2304,8 +2304,8 @@ traceHandle prvTraceGetObjectHandle(traceObjectClass objectclass)
        TRACE_ALLOC_CRITICAL_SECTION();\r
 \r
        TRACE_ASSERT(RecorderDataPtr != NULL, "Recorder not initialized, call vTraceEnable() first!", (traceHandle)0);\r
-       \r
-       TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+\r
+       TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
                "prvTraceGetObjectHandle: Invalid value for objectclass", (traceHandle)0);\r
 \r
        trcCRITICAL_SECTION_BEGIN();\r
@@ -2352,9 +2352,9 @@ void prvTraceFreeObjectHandle(traceObjectClass objectclass, traceHandle handle)
 {\r
        int indexOfHandle;\r
 \r
-       TRACE_ASSERT(objectclass < TRACE_NCLASSES, \r
+       TRACE_ASSERT(objectclass < TRACE_NCLASSES,\r
                "prvTraceFreeObjectHandle: Invalid value for objectclass", TRC_UNUSED);\r
-       TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass], \r
+       TRACE_ASSERT(handle > 0 && handle <= RecorderDataPtr->ObjectPropertyTable.NumberOfObjectsPerClass[objectclass],\r
                "prvTraceFreeObjectHandle: Invalid value for handle", TRC_UNUSED);\r
 \r
        /* Check that there is room to push the handle on the stack */\r
@@ -2451,10 +2451,10 @@ traceString prvTraceOpenSymbol(const char* name, traceString userEventChannel)
        uint8_t len;\r
        uint8_t crc;\r
        TRACE_ALLOC_CRITICAL_SECTION();\r
-       \r
+\r
        len = 0;\r
        crc = 0;\r
-       \r
+\r
        TRACE_ASSERT(name != NULL, "prvTraceOpenSymbol: name == NULL", (traceString)0);\r
 \r
        prvTraceGetChecksum(name, &crc, &len);\r
@@ -2557,7 +2557,7 @@ void prvCheckDataToBeOverwrittenForMultiEntryEvents(uint8_t nofEntriesToCheck)
        unsigned int i = 0;\r
        unsigned int e = 0;\r
 \r
-       TRACE_ASSERT(nofEntriesToCheck != 0, \r
+       TRACE_ASSERT(nofEntriesToCheck != 0,\r
                "prvCheckDataToBeOverwrittenForMultiEntryEvents: nofEntriesToCheck == 0", TRC_UNUSED);\r
 \r
        while (i < nofEntriesToCheck)\r
@@ -2597,12 +2597,12 @@ void prvCheckDataToBeOverwrittenForMultiEntryEvents(uint8_t nofEntriesToCheck)
  * Updates the index of the event buffer.\r
  ******************************************************************************/\r
 void prvTraceUpdateCounters(void)\r
-{      \r
+{\r
        if (RecorderDataPtr->recorderActive == 0)\r
        {\r
                return;\r
        }\r
-       \r
+\r
        RecorderDataPtr->numEvents++;\r
 \r
        RecorderDataPtr->nextFreeIndex++;\r
@@ -2641,34 +2641,34 @@ uint16_t prvTraceGetDTS(uint16_t param_maxDTS)
 \r
        TRACE_ASSERT(param_maxDTS == 0xFF || param_maxDTS == 0xFFFF, "prvTraceGetDTS: Invalid value for param_maxDTS", 0);\r
 \r
-       \r
+\r
        if (RecorderDataPtr->frequency == 0)\r
-       {       \r
+       {\r
                if (timestampFrequency != 0)\r
                {\r
                        /* If to override default TRC_HWTC_FREQ_HZ value with value set by vTraceSetFrequency */\r
                        RecorderDataPtr->frequency = timestampFrequency / (TRC_HWTC_DIVISOR);\r
-               } \r
+               }\r
                else if (init_hwtc_count != (TRC_HWTC_COUNT))\r
                {\r
-                       /* If using default value and timer has been started. \r
+                       /* If using default value and timer has been started.\r
                        Note: If the default frequency value set here would be incorrect, e.g.,\r
-                       if the timer has actually not been configured yet, override this \r
+                       if the timer has actually not been configured yet, override this\r
                        with vTraceSetFrequency.\r
                        */\r
-                       RecorderDataPtr->frequency = (TRC_HWTC_FREQ_HZ) / (TRC_HWTC_DIVISOR);           \r
+                       RecorderDataPtr->frequency = (TRC_HWTC_FREQ_HZ) / (TRC_HWTC_DIVISOR);\r
                }\r
                /* If no override (vTraceSetFrequency) and timer inactive -> no action */\r
        }\r
-       \r
+\r
        /**************************************************************************\r
        * The below statements read the timestamp from the timer port module.\r
        * If necessary, whole seconds are extracted using division while the rest\r
        * comes from the modulo operation.\r
        **************************************************************************/\r
-       \r
-       prvTracePortGetTimeStamp(&timestamp);   \r
-       \r
+\r
+       prvTracePortGetTimeStamp(&timestamp);\r
+\r
        /***************************************************************************\r
        * Since dts is unsigned the result will be correct even if timestamp has\r
        * wrapped around.\r
@@ -2878,14 +2878,14 @@ void prvTraceGetChecksum(const char *pname, uint8_t* pcrc, uint8_t* plength)
 \r
 #if (TRC_CFG_USE_16BIT_OBJECT_HANDLES == 1)\r
 \r
-static void prvTraceStoreXID(traceHandle handle); \r
+static void prvTraceStoreXID(traceHandle handle);\r
 \r
 /******************************************************************************\r
  * prvTraceStoreXID\r
  *\r
  * Stores an XID (eXtended IDentifier) event.\r
  * This is used if an object/task handle is larger than 255.\r
- * The parameter "handle" is the full (16 bit) handle, assumed to be 256 or \r
+ * The parameter "handle" is the full (16 bit) handle, assumed to be 256 or\r
  * larger. Handles below 256 should not use this function.\r
  *\r
  * NOTE: this function MUST be called from within a critical section.\r
@@ -2903,7 +2903,7 @@ static void prvTraceStoreXID(traceHandle handle)
                xid->type = XID;\r
 \r
                /* This function is (only) used when traceHandle is 16 bit... */\r
-               xid->xps_16 = handle; \r
+               xid->xps_16 = handle;\r
 \r
                prvTraceUpdateCounters();\r
        }\r
@@ -2912,11 +2912,11 @@ static void prvTraceStoreXID(traceHandle handle)
 static uint8_t prvTraceGet8BitHandle(traceHandle handle)\r
 {\r
        if (handle > 255)\r
-       {               \r
+       {\r
                prvTraceStoreXID(handle);\r
-               /* The full handle (16 bit) is stored in the XID event. \r
+               /* The full handle (16 bit) is stored in the XID event.\r
                This code (255) is used instead of zero (which is an error code).*/\r
-               return 255; \r
+               return 255;\r
        }\r
        return (uint8_t)(handle & 0xFF);\r
 }\r
@@ -2939,15 +2939,15 @@ void prvTraceInitCortexM()
                if (TRC_REG_DEMCR == 0)\r
                {\r
                        /* This function is called on Cortex-M3, M4 and M7 devices to initialize\r
-                       the DWT unit, assumed present. The DWT cycle counter is used for timestamping. \r
-                       \r
+                       the DWT unit, assumed present. The DWT cycle counter is used for timestamping.\r
+\r
                        If the below error is produced, the DWT unit does not seem to be available.\r
-                       \r
+\r
                        In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build\r
-                       to use SysTick timestamping instead, or define your own timestamping by \r
+                       to use SysTick timestamping instead, or define your own timestamping by\r
                        setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED\r
                        and make the necessary definitions, as explained in trcHardwarePort.h.*/\r
-                       \r
+\r
                        prvTraceError("DWT unit not available, see code comment.");\r
                        break;\r
                }\r
@@ -2956,12 +2956,12 @@ void prvTraceInitCortexM()
                if (TRC_REG_DWT_CTRL & TRC_DWT_CTRL_NOCYCCNT)\r
                {\r
                        /* This function is called on Cortex-M3, M4 and M7 devices to initialize\r
-                       the DWT unit, assumed present. The DWT cycle counter is used for timestamping. \r
-                       \r
+                       the DWT unit, assumed present. The DWT cycle counter is used for timestamping.\r
+\r
                        If the below error is produced, the cycle counter does not seem to be available.\r
-                       \r
+\r
                        In that case, define the macro TRC_CFG_ARM_CM_USE_SYSTICK in your build\r
-                       to use SysTick timestamping instead, or define your own timestamping by \r
+                       to use SysTick timestamping instead, or define your own timestamping by\r
                        setting TRC_CFG_HARDWARE_PORT to TRC_HARDWARE_PORT_APPLICATION_DEFINED\r
                        and make the necessary definitions, as explained in trcHardwarePort.h.*/\r
 \r
@@ -3071,20 +3071,20 @@ void prvTracePortGetTimeStamp(uint32_t *pTimestamp)
        }\r
        /* Store the previous value */\r
        last_traceTickCount = traceTickCount;\r
-       \r
+\r
 #else /*(TRC_HWTC_TYPE == TRC_OS_TIMER_INCR || TRC_HWTC_TYPE == TRC_OS_TIMER_DECR)*/\r
-       \r
+\r
        /* Timestamping is based on a free running timer */\r
        /* This part handles free running clocks that can be scaled down to avoid too large DTS values.\r
        Without this, the scaled timestamp will incorrectly wrap at (2^32 / TRC_HWTC_DIVISOR) ticks.\r
        The scaled timestamp returned from this function is supposed to go from 0 -> 2^32, which in real time would represent (0 -> 2^32 * TRC_HWTC_DIVISOR) ticks. */\r
-       \r
+\r
        /* First we see how long time has passed since the last timestamp call, and we also add the ticks that was lost when we scaled down the last time. */\r
        diff = (hwtc_count - last_hwtc_count) + last_hwtc_rest;\r
-       \r
+\r
        /* Scale down the diff */\r
        diff_scaled = diff / (TRC_HWTC_DIVISOR);\r
-       \r
+\r
        /* Find out how many ticks were lost when scaling down, so we can add them the next time */\r
        last_hwtc_rest = diff % (TRC_HWTC_DIVISOR);\r
 \r