From ace232a91e49a573f6db4fa1111f760fbeacffb7 Mon Sep 17 00:00:00 2001 From: Commaremote <31535535+commaremote@user.noreply.github.com> Date: Fri, 25 May 2018 14:17:02 -0700 Subject: [PATCH] Cadillac: ignition bug --- board/safety/safety_cadillac.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/safety/safety_cadillac.h b/board/safety/safety_cadillac.h index e0875ab7a40a22..8b5c61494646fa 100644 --- a/board/safety/safety_cadillac.h +++ b/board/safety/safety_cadillac.h @@ -1,4 +1,4 @@ -const int CADILLAC_IGNITION_TIMEOUT = 1000000; +const int CADILLAC_IGNITION_TIMEOUT = 1000000; // 1s int cadillac_can_seen = 0; uint32_t cadillac_ts_last = 0; @@ -20,6 +20,7 @@ static int cadillac_ign_hook() { uint32_t ts = TIM2->CNT; uint32_t ts_elapsed = get_ts_elapsed(ts, cadillac_ts_last); if ((ts_elapsed > CADILLAC_IGNITION_TIMEOUT) || (!cadillac_can_seen)) { + cadillac_can_seen = 0; return 0; } return 1;