/******************************************************************************* * TzCtrl * * Task for receiving commands from Tracealyzer and for recorder diagnostics. * ******************************************************************************/ static portTASK_FUNCTION( TzCtrl, pvParameters ) { TracealyzerCommandType msg; int bytes = 0; while (1) { bytes = 0; TRC_STREAM_PORT_READ_DATA(&msg, sizeof(TracealyzerCommandType), &bytes); if (bytes != 0) { if (bytes == sizeof(TracealyzerCommandType)) { if (isValidCommand(&msg)) { processCommand(&msg); /* Start or Stop currently... */ } } } do { bytes = 0; TRC_STREAM_PORT_PERIODIC_SEND_DATA(&bytes); } while (bytes != 0); CheckRecorderStatus(); vTaskDelay(TRC_CTRL_TASK_DELAY); /* 10ms */ } }
/******************************************************************************* * TzCtrl * * Task for receiving commands from embOS-Trace and for recorder diagnostics. * * Stack size and priority is configured in trcKernelPort.h, using: * - TZCTRL_TASK_STACK_SIZE (default 512) * - TZCTRL_TASK_PRIORITY (default 10) ******************************************************************************/ static portTASK_FUNCTION( TzCtrl, pvParameters ) { TracealyzerCommandType msg; int bytes = 0; while (1) { bytes = SEGGER_RTT_Read(TRC_RTT_DOWN_BUFFER_INDEX, (char*)&msg, sizeof(TracealyzerCommandType)); if (bytes != 0) { if (bytes == sizeof(TracealyzerCommandType)) { if (isValidCommand(&msg)) { processCommand(&msg); /* Start or Stop currently... */ } } } else { CheckRecorderStatus(); vTaskDelay((100 * configTICK_RATE_HZ) / 1000); /* 100ms */ } } }