From 13d2ee03bc0a7f3db49df841981f2bd4711e7ab0 Mon Sep 17 00:00:00 2001 From: Matthew Kennedy Date: Thu, 13 May 2021 14:35:00 -0700 Subject: [PATCH] idle indicators (#2692) * add coasting bit * remove useless bit --- firmware/console/binary/tunerstudio_outputs.h | 3 ++- firmware/console/status_loop.cpp | 1 - firmware/controllers/actuators/idle_thread.cpp | 3 ++- firmware/tunerstudio/rusefi.input | 7 ++++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/firmware/console/binary/tunerstudio_outputs.h b/firmware/console/binary/tunerstudio_outputs.h index 37dfcf7d5f..975f4d4e4e 100644 --- a/firmware/console/binary/tunerstudio_outputs.h +++ b/firmware/console/binary/tunerstudio_outputs.h @@ -52,7 +52,7 @@ typedef struct { unsigned int hasSdCard : 1; // bit 0, 72 unsigned int isIgnitionEnabledIndicator : 1; // bit 1 unsigned int isInjectionEnabledIndicator : 1; // bit 2 - unsigned int isCylinderCleanupEnabled : 1; // bit 3 + unsigned int unusedb3 : 1; // bit 3 unsigned int isCylinderCleanupActivated : 1; // bit 4 unsigned int isFuelPumpOn : 1; // bit 5 unsigned int isFanOn : 1; // bit 6 @@ -80,6 +80,7 @@ typedef struct { unsigned int launchTriggered : 1; // bit 28 unsigned int isTps2Error : 1; // bit 29 unsigned int isIdleClosedLoop : 1; // bit 30 + unsigned int isIdleCoasting : 1; // bit 31 // RPM, vss scaled_channel rpm; // 4 diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index 5ff6f62d43..7d2e76a7e0 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -699,7 +699,6 @@ void updateTunerStudioState(TunerStudioOutputChannels *tsOutputChannels DECLARE_ tsOutputChannels->isO2HeaterOn = enginePins.o2heater.getLogicValue(); tsOutputChannels->isIgnitionEnabledIndicator = ENGINE(limpManager).allowIgnition(); tsOutputChannels->isInjectionEnabledIndicator = ENGINE(limpManager).allowInjection(); - tsOutputChannels->isCylinderCleanupEnabled = engineConfiguration->isCylinderCleanupEnabled; tsOutputChannels->isCylinderCleanupActivated = engine->isCylinderCleanupMode; #if EFI_VEHICLE_SPEED diff --git a/firmware/controllers/actuators/idle_thread.cpp b/firmware/controllers/actuators/idle_thread.cpp index 0013496e10..c879c679b9 100644 --- a/firmware/controllers/actuators/idle_thread.cpp +++ b/firmware/controllers/actuators/idle_thread.cpp @@ -535,7 +535,8 @@ static percent_t automaticIdleController(float tpsPos, float rpm, int targetRpm, } #if EFI_TUNER_STUDIO - tsOutputChannels.isIdleClosedLoop = phase == Phase::Idling && CONFIG(idleMode) == IM_AUTO; + tsOutputChannels.isIdleClosedLoop = phase == Phase::Idling; + tsOutputChannels.isIdleCoasting = phase == Phase::Coasting; if (engineConfiguration->debugMode == DBG_IDLE_CONTROL) { if (engineConfiguration->idleMode == IM_AUTO) { diff --git a/firmware/tunerstudio/rusefi.input b/firmware/tunerstudio/rusefi.input index e925aef54e..aa55662a36 100644 --- a/firmware/tunerstudio/rusefi.input +++ b/firmware/tunerstudio/rusefi.input @@ -179,8 +179,7 @@ enable2ndByteCanID = false ; Bit flags hasSdCard = bits, U32, 0, [0:0], "true", "false"; isIgnitionEnabledIndicator=bits,U32, 0, [1:1], "true", "false"; - isInjectionEnabledIndicator=bits,U32, 0, [2:2], "true", "false"; - isCylinderCleanupEnabled=bits,U32, 0, [3:3], "true", "false"; + isInjectionEnabledIndicator=bits,U32,0, [2:2], "true", "false"; isCylinderCleanupActivated=bits,U32, 0, [4:4], "true", "false"; ind_fuel_pump = bits, U32, 0, [5:5], "true", "false"; ind_fan = bits, U32, 0, [6:6], "true", "false"; @@ -206,6 +205,7 @@ enable2ndByteCanID = false ind_pedal_error =bits, U32, 0, [26:26], "true", "false"; isTps2Error = bits, U32, 0, [29:29], "true", "false"; isIdleClosedLoop= bits, U32, 0, [30:30], "true", "false"; + isIdleCoasting = bits, U32, 0, [31:31], "true", "false"; ; RPM, vss RPMValue = scalar, U16, 4, "RPM", 1, 0.00000 @@ -1198,7 +1198,8 @@ gaugeCategory = DynoView indicator = { clutchDownState }, "clutch", "cltch Down", white, black, yellow, black indicator = { brakePedalIndicator }, "brake", "brake down", white, black, red, black indicator = { acSwitchState }, "AC off", "AC on", white, black, blue, white - indicator = { isIdleClosedLoop }, "idle open loop", "idle closed loop", white, black, green, black + indicator = { isIdleClosedLoop }, "not idling", "idling", white, black, green, black + indicator = { isIdleCoasting }, "not coasting", "coasting", white, black, green, black ; error codes indicator = { isTpsError}, "tps", "tps error", white, black, red, black