diff --git a/firmware/console/binary/tunerstudio.cpp b/firmware/console/binary/tunerstudio.cpp index d7e77b4e4b..5a746e2541 100644 --- a/firmware/console/binary/tunerstudio.cpp +++ b/firmware/console/binary/tunerstudio.cpp @@ -144,7 +144,7 @@ static void resetTs(void) { static void printErrorCounters(void) { scheduleMsg(&tsLogger, "TunerStudio size=%d / total=%d / errors=%d / H=%d / O=%d / P=%d / B=%d", - sizeof(tsOutputChannels), tsState.tsCounter, tsState.errorCounter, tsState.queryCommandCounter, + sizeof(tsOutputChannels), tsState.totalCounter, 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); @@ -454,7 +454,7 @@ void runBinaryProtocolLoop(ts_channel_s *tsChannel, bool isConsoleRedirect) { // scheduleSimpleMsg(&logger, "ts channel is now ready ", hTimeNow()); } - tsState.tsCounter++; + tsState.totalCounter++; uint8_t firstByte; int recieved = chnReadTimeout(tsChannel->channel, &firstByte, 1, TS_READ_TIMEOUT); @@ -637,6 +637,8 @@ static void handleGetVersion(ts_channel_s *tsChannel) { } static void handleGetText(ts_channel_s *tsChannel) { + tsState.textCommandCounter++; + int outputSize; char *output = swapOutputBuffers(&outputSize); #if EFI_SIMULATOR || defined(__DOXYGEN__) diff --git a/firmware/console/binary/tunerstudio.h b/firmware/console/binary/tunerstudio.h index cbca42f53e..10c3bc135b 100644 --- a/firmware/console/binary/tunerstudio.h +++ b/firmware/console/binary/tunerstudio.h @@ -27,7 +27,8 @@ typedef struct { int crc32CheckCommandCounter; int writeChunkCommandCounter; int errorCounter; - int tsCounter; + int totalCounter; + int textCommandCounter; } tunerstudio_counters_s; bool handlePlainCommand(ts_channel_s *tsChannel, uint8_t command); diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 7ebe8de67f..f66ec5ce06 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -86,6 +86,7 @@ extern TunerStudioOutputChannels tsOutputChannels; #endif extern bool hasFirmwareErrorFlag; +extern tunerstudio_counters_s tsState; #define FULL_LOGGING_KEY "fl" static char LOGGING_BUFFER[1400] CCM_OPTIONAL; @@ -730,6 +731,9 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ if (engineConfiguration->debugMode == DBG_TPS_ACCEL) { tsOutputChannels->debugIntField1 = engine->tpsAccelEnrichment.cb.getSize(); + } else if (engineConfiguration->debugMode == DBG_SR5_PROTOCOL) { + tsOutputChannels->debugIntField1 = tsState.textCommandCounter * 1000000 + tsState.burnCommandCounter + tsState.totalCounter; + tsOutputChannels->debugIntField2 = tsState.outputChannelsCommandCounter * 100000 + tsState.readPageCommandsCounter * 1000 + tsState.writeValueCommandCounter; } if (engineConfiguration->debugMode == DBG_TRIGGER_INPUT) { diff --git a/firmware/controllers/algo/rusefi_enums.h b/firmware/controllers/algo/rusefi_enums.h index 381b2d0b5c..feb8b270ec 100644 --- a/firmware/controllers/algo/rusefi_enums.h +++ b/firmware/controllers/algo/rusefi_enums.h @@ -682,7 +682,7 @@ typedef enum { DBG_FUEL_PID_CORRECTION = 11, DBG_VEHICLE_SPEED_SENSOR = 12, DBG_SD_CARD = 13, - DM_14 = 14, + DBG_SR5_PROTOCOL = 14, DM_15 = 15, DM_16 = 16, DM_17 = 17, diff --git a/firmware/rusefi.cpp b/firmware/rusefi.cpp index 4eb3315e11..f4bdedc98d 100644 --- a/firmware/rusefi.cpp +++ b/firmware/rusefi.cpp @@ -250,5 +250,5 @@ int getRusEfiVersion(void) { return 123; // this is here to make the compiler happy about the unused array if (UNUSED_CCM_SIZE[0] * 0 != 0) return 3211; // this is here to make the compiler happy about the unused array - return 20170323; + return 20170326; }