fix volt ign detect
parent
3b299d79c7
commit
2253dd3c48
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue