diff --git a/firmware/console/status_loop.cpp b/firmware/console/status_loop.cpp index b9fc293352..6387968ba3 100644 --- a/firmware/console/status_loop.cpp +++ b/firmware/console/status_loop.cpp @@ -330,11 +330,11 @@ static OutputPin *leds[] = { &enginePins.warningLedPin, &enginePins.runningLedPi &enginePins.errorLedPin, &enginePins.communicationLedPin, &enginePins.checkEnginePin }; static void initStatusLeds(void) { - enginePins.communicationLedPin.initPin("led: comm status", engineConfiguration->communicationLedPin, &LED_COMMUNICATION_BRAIN_PIN_MODE); + enginePins.communicationLedPin.initPin("led: comm status", engineConfiguration->communicationLedPin, &LED_COMMUNICATION_BRAIN_PIN_MODE, true); // checkEnginePin is already initialized by the time we get here - enginePins.warningLedPin.initPin("led: warning status", engineConfiguration->warningLedPin, &LED_WARNING_BRAIN_PIN_MODE); - enginePins.runningLedPin.initPin("led: running status", engineConfiguration->runningLedPin, &LED_RUNING_BRAIN_PIN_MODE); + enginePins.warningLedPin.initPin("led: warning status", engineConfiguration->warningLedPin, &LED_WARNING_BRAIN_PIN_MODE, true); + enginePins.runningLedPin.initPin("led: running status", engineConfiguration->runningLedPin, &LED_RUNING_BRAIN_PIN_MODE, true); } #if EFI_PROD_CODE diff --git a/firmware/controllers/system/efi_gpio.cpp b/firmware/controllers/system/efi_gpio.cpp index c84f4af455..a3d44b1042 100644 --- a/firmware/controllers/system/efi_gpio.cpp +++ b/firmware/controllers/system/efi_gpio.cpp @@ -475,7 +475,7 @@ void OutputPin::initPin(const char *msg, brain_pin_e brainPin) { initPin(msg, brainPin, &DEFAULT_OUTPUT); } -void OutputPin::initPin(const char *msg, brain_pin_e brainPin, const pin_output_mode_e *outputMode) { +void OutputPin::initPin(const char *msg, brain_pin_e brainPin, const pin_output_mode_e *outputMode, bool forceInitWithFatalError) { if (!isBrainPinValid(brainPin)) { return; } @@ -483,7 +483,7 @@ void OutputPin::initPin(const char *msg, brain_pin_e brainPin, const pin_output_ // Enter a critical section so that other threads can't change the pin state out from underneath us chibios_rt::CriticalSectionLocker csl; - if (hasFirmwareError()) { + if (!forceInitWithFatalError && hasFirmwareError()) { // Don't allow initializing more pins if we have a fatal error. // Pins should have just been reset, so we shouldn't try to init more. return; diff --git a/firmware/controllers/system/efi_gpio.h b/firmware/controllers/system/efi_gpio.h index 868b606dc1..6875da5472 100644 --- a/firmware/controllers/system/efi_gpio.h +++ b/firmware/controllers/system/efi_gpio.h @@ -42,7 +42,7 @@ public: * outputMode being a pointer allow us to change configuration (for example invert logical pin) in configuration and get resuts applied * away, or at least I hope that's why */ - void initPin(const char *msg, brain_pin_e brainPin, const pin_output_mode_e *outputMode); + void initPin(const char *msg, brain_pin_e brainPin, const pin_output_mode_e *outputMode, bool forceInitWithFatalError = false); /** * same as above, with DEFAULT_OUTPUT mode */