1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/samd5x/can: set EFF and RTR Flag if received

This commit is contained in:
Karl Fessel 2024-05-02 10:44:38 +02:00
parent a620a3c27f
commit 1d53d31339

View File

@ -716,7 +716,12 @@ static void _isr(candev_t *candev)
else {
DEBUG_PUTS("Received extended CAN frame");
frame_received.can_id = dev->msg_ram_conf.rx_fifo_0[rx_get_idx].RXF0E_0.bit.ID;
frame_received.can_id |= CAN_EFF_FLAG;
}
if (dev->msg_ram_conf.rx_fifo_0[rx_get_idx].RXF0E_0.bit.RTR) {
frame_received.can_id |= CAN_RTR_FLAG;
}
frame_received.can_dlc = dev->msg_ram_conf.rx_fifo_0[rx_get_idx].RXF0E_1.bit.DLC;
memcpy(frame_received.data, (uint32_t *)dev->msg_ram_conf.rx_fifo_0[rx_get_idx].RXF0E_DATA, frame_received.can_dlc);
@ -747,7 +752,12 @@ static void _isr(candev_t *candev)
else {
DEBUG_PUTS("Received extended CAN frame");
frame_received.can_id = dev->msg_ram_conf.rx_fifo_1[rx_get_idx].RXF1E_0.bit.ID;
frame_received.can_id |= CAN_EFF_FLAG;
}
if (dev->msg_ram_conf.rx_fifo_1[rx_get_idx].RXF1E_0.bit.RTR) {
frame_received.can_id |= CAN_RTR_FLAG;
}
frame_received.can_dlc = dev->msg_ram_conf.rx_fifo_1[rx_get_idx].RXF1E_1.bit.DLC;
memcpy(frame_received.data, (uint32_t *)dev->msg_ram_conf.rx_fifo_1[rx_get_idx].RXF1E_DATA, frame_received.can_dlc);