Skip to content

Commit

Permalink
firmwareError: set hasFirmwareErrorFlag as soon as possible
Browse files Browse the repository at this point in the history
To avoid reentrance and infinity error loop
  • Loading branch information
dron0gus committed Mar 11, 2024
1 parent 92106db commit 0dbd968
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion firmware/controllers/core/error_handling.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,6 +266,7 @@ void firmwareError(ObdCode code, const char *fmt, ...) {
#if EFI_PROD_CODE
if (hasFirmwareErrorFlag)
return;
hasFirmwareErrorFlag = true;
#if EFI_ENGINE_CONTROL
getLimpManager()->fatalError();
#endif // EFI_ENGINE_CONTROL
Expand All @@ -281,7 +282,6 @@ void firmwareError(ObdCode code, const char *fmt, ...) {
criticalShutdown();
enginePins.communicationLedPin.setValue(1, /*force*/true);

hasFirmwareErrorFlag = true;
if (indexOf(fmt, '%') == -1) {
/**
* in case of simple error message let's reduce stack usage
Expand Down

0 comments on commit 0dbd968

Please sign in to comment.