From e2f73d2a4b950718d874983b12668c795acce57d Mon Sep 17 00:00:00 2001 From: Jennifer Strange Date: Fri, 2 Mar 2018 23:24:35 -0800 Subject: [PATCH] enable has a whole byte to itself --- board/pedal/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/board/pedal/main.c b/board/pedal/main.c index 1e6788e9398ef4..0e338db501cfe0 100644 --- a/board/pedal/main.c +++ b/board/pedal/main.c @@ -135,8 +135,8 @@ void CAN1_RX0_IRQHandler() { uint16_t value_0 = (dat[0] << 8) | dat[1]; uint16_t value_1 = (dat[2] << 8) | dat[3]; uint8_t enable = (dat2[0] >> 7) & 1; - uint8_t index = (dat2[0] >> 4) & 3; - if (can_cksum(dat, 4, CAN_GAS_INPUT, (enable<<3) | index) == (dat2[0] & 0xF)) { + uint8_t index = (dat2[1] >> 4) & 3; + if (can_cksum(dat, 5, CAN_GAS_INPUT, index) == (dat2[1] & 0xF)) { if (((current_index+1)&3) == index) { #ifdef DEBUG puts("setting gas ");