diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index f3f829c696..51ec67b6f8 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -27,6 +27,7 @@ #include "pch.h" #include "status_loop.h" #include "hip9011_logic.h" +#include "electronic_throttle.h" #if EFI_LOGIC_ANALYZER #include "logic_analyzer.h" @@ -644,6 +645,26 @@ void updateTunerStudioState() { float rpm = Sensor::get(SensorType::Rpm).value_or(0); + + static Timer blinkIndicatorsTimer; + constexpr float blinkHalfPeriod = 0.3; + bool isBlinkPhase = blinkIndicatorsTimer.hasElapsedSec(blinkHalfPeriod); +#if EFI_ELECTRONIC_THROTTLE_BODY + blinkEtbErrorCodes(isBlinkPhase); +#endif // EFI_ELECTRONIC_THROTTLE_BODY + if (isBlinkPhase) { + engine->outputChannels.sparkCutReasonBlinker = 0; + engine->outputChannels.fuelCutReasonBlinker = 0; + + if (blinkIndicatorsTimer.hasElapsedSec(2 * blinkHalfPeriod)) { + blinkIndicatorsTimer.reset(); + } + } else { + engine->outputChannels.sparkCutReasonBlinker = engine->outputChannels.sparkCutReason; + engine->outputChannels.fuelCutReasonBlinker = engine->outputChannels.fuelCutReason; + } + + #if EFI_PROD_CODE executorStatistics(); #endif /* EFI_PROD_CODE */ diff --git a/firmware/controllers/actuators/electronic_throttle.cpp b/firmware/controllers/actuators/electronic_throttle.cpp index b67c43d437..13a5531afe 100644 --- a/firmware/controllers/actuators/electronic_throttle.cpp +++ b/firmware/controllers/actuators/electronic_throttle.cpp @@ -762,6 +762,12 @@ static EtbImpl etb2(throttle2TrimTable); static_assert(ETB_COUNT == 2); static EtbController* etbControllers[] = { &etb1, &etb2 }; +void blinkEtbErrorCodes(bool blinkPhase) { + for (int i = 0;ietbErrorCodeBlinker = blinkPhase ? 0 : etbControllers[i]->etbErrorCode; + } +} + #if !EFI_UNIT_TEST struct DcThread final : public PeriodicController<512> { diff --git a/firmware/controllers/actuators/electronic_throttle.h b/firmware/controllers/actuators/electronic_throttle.h index 50eddf02b0..0d583f2566 100644 --- a/firmware/controllers/actuators/electronic_throttle.h +++ b/firmware/controllers/actuators/electronic_throttle.h @@ -19,6 +19,8 @@ void setEtbWastegatePosition(percent_t pos); void setEtbLuaAdjustment(percent_t adjustment); void setHitachiEtbCalibration(); +void blinkEtbErrorCodes(bool blinkPhase); + // same plug as 18919 AM810 but have different calibrations void setToyota89281_33010_pedal_position_sensor(); diff --git a/firmware/tunerstudio/tunerstudio.template.ini b/firmware/tunerstudio/tunerstudio.template.ini index a8d3e9faf9..f086086016 100644 --- a/firmware/tunerstudio/tunerstudio.template.ini +++ b/firmware/tunerstudio/tunerstudio.template.ini @@ -1837,9 +1837,9 @@ gaugeCategory = GPPWM Outputs indicator = { isWarnNow }, "No warnings", "Warning", white, black, yellow, black indicator = { checkEngine }, "No Check Engine", "Check Engine", white, black, red, black indicator = { isTriggerError}, "Trigger OK", "Trigger ERR", white, black, red, black - indicator = { fuelCutReason != 0 }, "Injection OK", { Fuel cut: bitStringValue(fuelIgnCutCodeList, fuelCutReason)}, white, black, yellow, black - indicator = { sparkCutReason != 0 }, "Ignition OK", { Ign cut: bitStringValue(fuelIgnCutCodeList, sparkCutReason)}, white, black, yellow, black - indicator = { etbErrorCode0 != 0 }, "ETB OK", { ETB: bitStringValue(etbCutCodeList, etbErrorCode0)}, white, black, yellow, black + indicator = { fuelCutReasonBlinker != 0 }, "Injection OK", { Fuel cut: bitStringValue(fuelIgnCutCodeList, fuelCutReason)}, white, black, yellow, black + indicator = { sparkCutReasonBlinker != 0 }, "Ignition OK", { Ign cut: bitStringValue(fuelIgnCutCodeList, sparkCutReason)}, white, black, yellow, black + indicator = { etbErrorCodeBlinker0 != 0 }, "ETB OK", { ETB: bitStringValue(etbCutCodeList, etbErrorCode0)}, white, black, yellow, black ; minor info indicator = { isFanOn }, "Fan off", "Fan on", white, black, green, black