We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e2c89d6 commit ace232aCopy full SHA for ace232a
board/safety/safety_cadillac.h
@@ -1,4 +1,4 @@
1
-const int CADILLAC_IGNITION_TIMEOUT = 1000000;
+const int CADILLAC_IGNITION_TIMEOUT = 1000000; // 1s
2
int cadillac_can_seen = 0;
3
uint32_t cadillac_ts_last = 0;
4
@@ -20,6 +20,7 @@ static int cadillac_ign_hook() {
20
uint32_t ts = TIM2->CNT;
21
uint32_t ts_elapsed = get_ts_elapsed(ts, cadillac_ts_last);
22
if ((ts_elapsed > CADILLAC_IGNITION_TIMEOUT) || (!cadillac_can_seen)) {
23
+ cadillac_can_seen = 0;
24
return 0;
25
}
26
return 1;
0 commit comments