mirror of
https://github.com/commaai/panda.git
synced 2026-06-15 08:36:36 +08:00
Cadillac: ignition bug
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user