Fix bit shifting in CO_CANtxBufferInit
Shifting by 12 overlaps RTR bit if DLC is 8 bytes.
This commit is contained in:
parent
91653819e7
commit
32274bef99
1 changed files with 1 additions and 1 deletions
|
|
@ -178,7 +178,7 @@ CO_CANtx_t *CO_CANtxBufferInit(
|
|||
/* CAN identifier, DLC and rtr, bit aligned with CAN module transmit buffer.
|
||||
* Microcontroller specific. */
|
||||
buffer->ident = ((uint32_t)ident & 0x07FFU)
|
||||
| ((uint32_t)(((uint32_t)noOfBytes & 0xFU) << 12U))
|
||||
| ((uint32_t)(((uint32_t)noOfBytes & 0xFU) << 11U))
|
||||
| ((uint32_t)(rtr ? 0x8000U : 0U));
|
||||
|
||||
buffer->bufferFull = false;
|
||||
|
|
|
|||
Loading…
Reference in a new issue