diff --git a/firmware/console/tunerstudio/tunerstudio.cpp b/firmware/console/tunerstudio/tunerstudio.cpp index 53f34f3cb5..8d5c82699a 100644 --- a/firmware/console/tunerstudio/tunerstudio.cpp +++ b/firmware/console/tunerstudio/tunerstudio.cpp @@ -104,17 +104,12 @@ static int ts_serial_ready(void) { // this thread wants a bit extra stack static THD_WORKING_AREA(tsThreadStack, UTILITY_THREAD_STACK_SIZE + 200); -static int tsCounter = 0; - -//static TunerStudioWriteValueRequest writeValueRequest; -//static TunerStudioWriteChunkRequest writeChunkRequest; - extern TunerStudioOutputChannels tsOutputChannels; extern tunerstudio_counters_s tsState; static void resetTs(void) { - + memset(&tsState, sizeof(tsState), 0); } /** @@ -133,7 +128,7 @@ void printTsStats(void) { } #endif /* EFI_PROD_CODE */ scheduleMsg(tsLogger, "TunerStudio size=%d / total=%d / errors=%d / H=%d / O=%d / P=%d / B=%d", - sizeof(tsOutputChannels), tsCounter, tsState.errorCounter, tsState.queryCommandCounter, + sizeof(tsOutputChannels), tsState.tsCounter, tsState.errorCounter, tsState.queryCommandCounter, tsState.outputChannelsCommandCounter, tsState.readPageCommandsCounter, tsState.burnCommandCounter); scheduleMsg(tsLogger, "TunerStudio W=%d / C=%d / P=%d / page=%d", tsState.writeValueCommandCounter, tsState.writeChunkCommandCounter, tsState.pageCommandCounter, currentPageId); @@ -464,7 +459,7 @@ static msg_t tsThreadEntryPoint(void *arg) { // scheduleSimpleMsg(&logger, "ts channel is now ready ", hTimeNow()); } - tsCounter++; + tsState.tsCounter++; int recieved = chSequentialStreamRead(getTsSerialDevice(), &firstByte, 1); if (recieved != 1) { diff --git a/firmware/console/tunerstudio/tunerstudio_algo.h b/firmware/console/tunerstudio/tunerstudio_algo.h index 89e3a277b2..9b31104ed0 100644 --- a/firmware/console/tunerstudio/tunerstudio_algo.h +++ b/firmware/console/tunerstudio/tunerstudio_algo.h @@ -32,6 +32,7 @@ typedef struct { int writeValueCommandCounter; int writeChunkCommandCounter; int errorCounter; + int tsCounter; } tunerstudio_counters_s; int tunerStudioHandleCrcCommand(uint8_t *data, int incomingPacketSize); diff --git a/firmware/controllers/error_handling.cpp b/firmware/controllers/error_handling.cpp index f16d2d41fe..abbecb4de3 100644 --- a/firmware/controllers/error_handling.cpp +++ b/firmware/controllers/error_handling.cpp @@ -1,5 +1,5 @@ /** - * @file error_handling.c + * @file error_handling.cpp * * @date Apr 1, 2014 * @author Andrey Belomutskiy, (c) 2012-2015