Skip to content

Commit d5a9e1e

Browse files
committed
correct checksum
1 parent f8ed9fa commit d5a9e1e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

board/pedal/main.c

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

0 commit comments

Comments
 (0)