Skip to content

Commit

Permalink
Cadillac: ignition bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Commaremote committed May 25, 2018
1 parent e2c89d6 commit ace232a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion board/safety/safety_cadillac.h
Original file line number Diff line number Diff line change
@@ -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;

Expand All @@ -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;
Expand Down

0 comments on commit ace232a

Please sign in to comment.