force init LEDs even with fatal (#2998)
This commit is contained in:
parent
1447647411
commit
e2a01b4c3e
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue