Merge pull request #5610 from garivetm/bugfix-STM32CAN

STM32 - CAN - Fix RTR position bit in TX mailbox register
pull/5689/merge
Martin Kojtal 2017-12-12 17:27:57 +00:00 committed by GitHub
commit 84192fe676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -277,9 +277,9 @@ int can_write(can_t *obj, CAN_Message msg, int cc)
can->sTxMailBox[transmitmailbox].TIR &= CAN_TI0R_TXRQ;
if (!(msg.format)) {
can->sTxMailBox[transmitmailbox].TIR |= ((msg.id << 21) | msg.type);
can->sTxMailBox[transmitmailbox].TIR |= ((msg.id << 21) | (msg.type << 1));
} else {
can->sTxMailBox[transmitmailbox].TIR |= ((msg.id << 3) | CAN_ID_EXT | msg.type);
can->sTxMailBox[transmitmailbox].TIR |= ((msg.id << 3) | CAN_ID_EXT | (msg.type << 1));
}
/* Set up the DLC */