turnAllPinsOff improvements #5429
This commit is contained in:
parent
163e4ddd40
commit
83d69b2c0a
|
@ -32,6 +32,7 @@ Release template (copy/paste this for new release):
|
||||||
- Dashpot for return-to-idle from coasting #5303
|
- Dashpot for return-to-idle from coasting #5303
|
||||||
- injector duty cycle limited at 50% for GDI engines #5416
|
- injector duty cycle limited at 50% for GDI engines #5416
|
||||||
- STM32Cube v2.14 #5418
|
- STM32Cube v2.14 #5418
|
||||||
|
- turning coils and injectors off in case of extremely unexpected errors #5429
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- fuel_pump_control is accessible as getOutput("isFuelPumpOn") in Lua #5239
|
- fuel_pump_control is accessible as getOutput("isFuelPumpOn") in Lua #5239
|
||||||
|
|
|
@ -79,7 +79,7 @@ void checkLastBootError() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void logHardFault(uint32_t type, uintptr_t faultAddress, port_extctx* ctx, uint32_t csfr) {
|
void logHardFault(uint32_t type, uintptr_t faultAddress, port_extctx* ctx, uint32_t csfr) {
|
||||||
TURN_FATAL_LED();
|
criticalShutdown();
|
||||||
#if EFI_BACKUP_SRAM
|
#if EFI_BACKUP_SRAM
|
||||||
auto sramState = getBackupSram();
|
auto sramState = getBackupSram();
|
||||||
sramState->Cookie = ErrorCookie::HardFault;
|
sramState->Cookie = ErrorCookie::HardFault;
|
||||||
|
@ -250,8 +250,7 @@ void firmwareError(ObdCode code, const char *fmt, ...) {
|
||||||
chvsnprintf(warningBuffer, sizeof(warningBuffer), fmt, ap);
|
chvsnprintf(warningBuffer, sizeof(warningBuffer), fmt, ap);
|
||||||
va_end(ap);
|
va_end(ap);
|
||||||
#endif
|
#endif
|
||||||
TURN_FATAL_LED();
|
criticalShutdown();
|
||||||
turnAllPinsOff();
|
|
||||||
enginePins.communicationLedPin.setValue(1);
|
enginePins.communicationLedPin.setValue(1);
|
||||||
|
|
||||||
hasFirmwareErrorFlag = true;
|
hasFirmwareErrorFlag = true;
|
||||||
|
|
|
@ -26,6 +26,10 @@ bool warning(ObdCode code, const char *fmt, ...);
|
||||||
|
|
||||||
using critical_msg_t = char[CRITICAL_BUFFER_SIZE];
|
using critical_msg_t = char[CRITICAL_BUFFER_SIZE];
|
||||||
|
|
||||||
|
#define criticalShutdown() \
|
||||||
|
TURN_FATAL_LED(); \
|
||||||
|
turnAllPinsOff();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Something really bad had happened - firmware cannot function, we cannot run the engine
|
* Something really bad had happened - firmware cannot function, we cannot run the engine
|
||||||
* We definitely use this critical error approach in case of invalid configuration. If user sets a self-contradicting
|
* We definitely use this critical error approach in case of invalid configuration. If user sets a self-contradicting
|
||||||
|
|
Loading…
Reference in New Issue