From 256bd609be800f07ea9f4d50d4ffe01e177a8bef Mon Sep 17 00:00:00 2001 From: Arduino Enigma Date: Tue, 28 Oct 2025 00:49:16 -0400 Subject: [PATCH] updated can.h to have arduino specific can_frame 3 bytes smaller than can_frame structure used by other compilers --- can.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/can.h b/can.h index 4735f81..4ee00af 100644 --- a/can.h +++ b/can.h @@ -36,10 +36,18 @@ typedef __u32 canid_t; #define CAN_MAX_DLC 8 #define CAN_MAX_DLEN 8 +#if defined(Arduino_h) +struct can_frame { + canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ + __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ + __u8 data[CAN_MAX_DLEN]; +}; +#else struct can_frame { canid_t can_id; /* 32 bit CAN_ID + EFF/RTR/ERR flags */ __u8 can_dlc; /* frame payload length in byte (0 .. CAN_MAX_DLEN) */ alignas(8) __u8 data[CAN_MAX_DLEN]; }; +#endif #endif /* CAN_H_ */