Skip to content

Commit 07a2b33

Browse files
authored
Fix: correctly distinguish between CAN frames with extended CAN ID and with standard CAN ID. (#9)
1 parent 37b8513 commit 07a2b33

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

recipes-kernel/kernel-modules/x8h7/x8h7_can.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,11 @@ static void x8h7_can_hw_tx(struct x8h7_can_priv *priv, struct can_frame *frame)
515515

516516
DBG_PRINT("\n");
517517

518-
can_msg.field.id = frame->can_id;
518+
if (frame->can_id & CAN_EFF_FLAG)
519+
can_msg.field.id = CAN_EFF_FLAG | (frame->can_id & CAN_EFF_MASK);
520+
else
521+
can_msg.field.id = (frame->can_id & CAN_SFF_MASK);
522+
519523
can_msg.field.len = (frame->can_dlc <= CAN_FRAME_MAX_DATA_LEN) ? frame->can_dlc : CAN_FRAME_MAX_DATA_LEN;
520524
memcpy(can_msg.field.data, frame->data, can_msg.field.len);
521525

recipes-kernel/linux-firmware/linux-firmware-arduino-portenta-x8-stm32h7_git.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SRC_URI = " \
1616
file://monitor-m4-elf-file.path \
1717
file://monitor-m4-elf-file.service \
1818
"
19-
SRCREV = "f78b86b9befae74a4222b4dfb0cb910820ab94b8"
19+
SRCREV = "96bcacb22b87f6f9169d1d01d531a4de641a3d63"
2020
PV = "0.0.2"
2121

2222
S = "${WORKDIR}/git"

0 commit comments

Comments
 (0)