From ac33561801fff26002d2cff76a6653ef35cc22b0 Mon Sep 17 00:00:00 2001 From: rusefillc Date: Mon, 12 Sep 2022 21:41:23 -0400 Subject: [PATCH] outputRequestPeriod into logs --- firmware/console/binary/tunerstudio_commands.cpp | 8 ++++---- firmware/tunerstudio/generated/rusefi.ini | 1 + 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/firmware/console/binary/tunerstudio_commands.cpp b/firmware/console/binary/tunerstudio_commands.cpp index 37d3ef4bc8..b2543bfea5 100644 --- a/firmware/console/binary/tunerstudio_commands.cpp +++ b/firmware/console/binary/tunerstudio_commands.cpp @@ -35,7 +35,7 @@ bool validateOffsetCount(size_t offset, size_t count, TsChannelBase* tsChannel) // the ECU. Forcing a reboot will force TS to re-read the tune CRC, bool rebootForPresetPending = false; -static efitimeus_t prevRequestTime = 0; +static efitick_t prevRequestTimeNt = 0; /** * @brief 'Output' command sends out a snapshot of current values @@ -50,9 +50,9 @@ void TunerStudio::cmdOutputChannels(TsChannelBase* tsChannel, uint16_t offset, u } if (offset < BLOCKING_FACTOR) { - efitimeus_t now = getTimeNowUs(); - engine->outputChannels.outputRequestPeriod = now - prevRequestTime; - prevRequestTime = now; + efitick_t nowNt = getTimeNowNt(); + engine->outputChannels.outputRequestPeriod = nowNt - prevRequestTimeNt; + prevRequestTimeNt = nowNt; } tsState.outputChannelsCommandCounter++; diff --git a/firmware/tunerstudio/generated/rusefi.ini b/firmware/tunerstudio/generated/rusefi.ini index 5fab7e518c..295795fdf9 100644 --- a/firmware/tunerstudio/generated/rusefi.ini +++ b/firmware/tunerstudio/generated/rusefi.ini @@ -4190,6 +4190,7 @@ gaugeCategory = ECU Status firmwareVersionGauge = firmwareVersion , "ECU Software Version", "%", 0, 100, 0, 0, 100, 100, 0, 0 timeSecondsGauge = seconds, "Uptime", "sec", 0, 100, 0, 0, 100, 100, 0, 0 tuneCrc16Gauge = tuneCrc16, "Tune CRC16", "", 0, 64000, 0, 0, 64000, 64000, 0, 0 + outputRequestPeriodGauge = outputRequestPeriod, "outputRequestPeriod", "", 0, 64000, 0, 0, 64000, 64000, 0, 0 gaugeCategory = Debug debugF1Gauge = debugFloatField1, {bitStringValue( debugFieldF1List, debugMode )}, "", 0, 100, 0, 0, 100, 100, 4, 4