Skip to content

Commit e2f73d2

Browse files
committed
enable has a whole byte to itself
1 parent d5a9e1e commit e2f73d2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

board/pedal/main.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ void CAN1_RX0_IRQHandler() {
135135
uint16_t value_0 = (dat[0] << 8) | dat[1];
136136
uint16_t value_1 = (dat[2] << 8) | dat[3];
137137
uint8_t enable = (dat2[0] >> 7) & 1;
138-
uint8_t index = (dat2[0] >> 4) & 3;
139-
if (can_cksum(dat, 4, CAN_GAS_INPUT, (enable<<3) | index) == (dat2[0] & 0xF)) {
138+
uint8_t index = (dat2[1] >> 4) & 3;
139+
if (can_cksum(dat, 5, CAN_GAS_INPUT, index) == (dat2[1] & 0xF)) {
140140
if (((current_index+1)&3) == index) {
141141
#ifdef DEBUG
142142
puts("setting gas ");

0 commit comments

Comments
 (0)