fix vBatt false-detection
This commit is contained in:
parent
4dcfb2f784
commit
f6c5ac8ebb
|
@ -522,7 +522,9 @@ void Engine::checkShutdown() {
|
||||||
// if the ignition key is turned on again,
|
// if the ignition key is turned on again,
|
||||||
// we cancel the shutdown mode, but only if all shutdown procedures are complete
|
// we cancel the shutdown mode, but only if all shutdown procedures are complete
|
||||||
const float vBattThresholdOn = 8.0f;
|
const float vBattThresholdOn = 8.0f;
|
||||||
if ((Sensor::get(SensorType::BatteryVoltage).value_or(VBAT_FALLBACK_VALUE) > vBattThresholdOn) && !isInShutdownMode()) {
|
// we fallback into zero instead of VBAT_FALLBACK_VALUE because it's not safe to false-trigger the "ignition on" event,
|
||||||
|
// and we want to turn on the main relay only when 100% sure.
|
||||||
|
if ((Sensor::get(SensorType::BatteryVoltage).value_or(0) > vBattThresholdOn) && !isInShutdownMode()) {
|
||||||
ignitionOnTimeNt = getTimeNowNt();
|
ignitionOnTimeNt = getTimeNowNt();
|
||||||
stopEngineRequestTimeNt = 0;
|
stopEngineRequestTimeNt = 0;
|
||||||
efiPrintf("Ignition voltage detected! Cancel the engine shutdown!");
|
efiPrintf("Ignition voltage detected! Cancel the engine shutdown!");
|
||||||
|
|
Loading…
Reference in New Issue