This commit is contained in:
rusefi 2022-09-18 18:55:57 -04:00
parent 61f778969f
commit 25aab4722b
1 changed files with 5 additions and 1 deletions

View File

@ -275,6 +275,7 @@ function onTick()
clt = getSensor("CLT") or 0
iat = getSensor("IAT") or 0
tps = getSensor("TPS1") or 0
vbat = getSensor("BatteryVoltage") or 0
fakeTorque = interpolate(0, 6, 100, 60, tps)
@ -305,7 +306,10 @@ function onTick()
txCan(1, MOTOR_7, 0, canMotor7)
if hadIgnitionEvent and shallSleep : getElapsedSeconds() > 3 then
local timeToTurnOff = shallSleep : getElapsedSeconds() > 2
local connectedToUsb = vbat < 4
if hadIgnitionEvent and timeToTurnOff then
-- looks like ignition key was removed
mcu_standby()
end