Skip to content

Commit

Permalink
enable has a whole byte to itself
Browse files Browse the repository at this point in the history
  • Loading branch information
jenstrange committed Mar 3, 2018
1 parent d5a9e1e commit e2f73d2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions board/pedal/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 ");
Expand Down

0 comments on commit e2f73d2

Please sign in to comment.