hellen: please no calls to OS code on possible hardFault paths

only:uaefi
This commit is contained in:
rusefillc 2025-01-14 08:12:46 -05:00
parent 9dac54ad17
commit a76f2e7380
3 changed files with 8 additions and 1 deletions

View File

@ -83,6 +83,12 @@ void hellenEnableEn(const char *msg) {
void hellenDisableEn(const char *msg) {
efiPrintf("Turning board off [%s]", msg);
hellenDisableEnSilently();
}
void hellenDisableEnSilently() {
// this function is called from criticalShutdown() that may be called from hardFault handler
// please no call to OS functions!
setHellenEnValue(0);
}

View File

@ -20,6 +20,7 @@ bool isBoardWithPowerManagement();
bool getHellenBoardEnabled();
void hellenEnableEn(const char *msg = "");
void hellenDisableEn(const char *msg = "");
void hellenDisableEnSilently(); // this version is called by fatal error handler meaning no OS access
void hellenBoardStandBy();
void hellenMegaSdWithAccelerometer();

View File

@ -847,7 +847,7 @@ void turnAllPinsOff() {
enginePins.fuelPumpRelay.setValue(false);
enginePins.checkEnginePin.setValue(true); // yes this one can go ON
#if EFI_PROD_CODE && HW_HELLEN
hellenDisableEn("fatal");
hellenDisableEnSilently();
#endif
}
#endif /* EFI_GPIO_HARDWARE */