diff --git a/board/main.c b/board/main.c index 671641afe47a8e..a15861a17e5c82 100644 --- a/board/main.c +++ b/board/main.c @@ -110,7 +110,7 @@ int get_health_pkt(void *dat) { health->started = (GPIOA->IDR & (1 << 1)) == 0; } else { //Current safety hooks want to determine ignition (ex: GM) - health-> started = safety_ignition; + health->started = safety_ignition; } #else health->current = 0; diff --git a/board/safety/safety_gm.h b/board/safety/safety_gm.h index 40fc14d54c8536..03c36d6255dcbf 100644 --- a/board/safety/safety_gm.h +++ b/board/safety/safety_gm.h @@ -19,6 +19,7 @@ int gm_ascm_detected = 0; int gm_ignition_started = 0; static void gm_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) { + int bus_number = (to_push->RDTR >> 4) & 0xFF; uint32_t addr; if (to_push->RIR & 4) { // Extended @@ -30,7 +31,7 @@ static void gm_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) { addr = to_push->RIR >> 21; } - if (addr == 0x135) { + if (addr == 0x135 && bus_number == 0) { //Gear selector (used for determining ignition) int gear = to_push->RDLR & 0x7; gm_ignition_started = gear > 0; //Park = 0. If out of park, we're "on." @@ -43,7 +44,6 @@ static void gm_rx_hook(CAN_FIFOMailBox_TypeDef *to_push) { } // check if stock ASCM ECU is still online - int bus_number = (to_push->RDTR >> 4) & 0xFF; if (bus_number == 0 && addr == 715) { gm_ascm_detected = 1; controls_allowed = 0;