only:small-can-board
This commit is contained in:
rusefillc 2023-10-19 12:13:45 -04:00
parent 59d8d82f32
commit 9a5dc408e6
1 changed files with 10 additions and 1 deletions

View File

@ -66,8 +66,17 @@ end
canRxAdd(1, 0x17C, onPOWERTRAIN_DATA)
canRxAdd(1, 0x309, onCAR_SPEED)
commTimer = Timer.new()
commTimer : reset()
canDelay = 1
commDelay = 20
function onTick()
if canTimer : getElapsedSeconds() > 20 then
if getOutput("isUsbConnected") == 1 then
commTimer : reset()
end
if (canTimer : getElapsedSeconds() > canDelay) and (commTimer : getElapsedSeconds() > commDelay) then
mcu_standby()
end
end