Skip to content

Commit

Permalink
correct checksum
Browse files Browse the repository at this point in the history
  • Loading branch information
jenstrange committed Mar 3, 2018
1 parent f8ed9fa commit d5a9e1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion board/pedal/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ void CAN1_RX0_IRQHandler() {
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, index) == (dat2[0] & 0xF)) {
if (can_cksum(dat, 4, CAN_GAS_INPUT, (enable<<3) | index) == (dat2[0] & 0xF)) {
if (((current_index+1)&3) == index) {
#ifdef DEBUG
puts("setting gas ");
Expand Down

0 comments on commit d5a9e1e

Please sign in to comment.