From cb1242d496133d75a3214186d3a3c4a19ca3f64e Mon Sep 17 00:00:00 2001 From: patacongo Date: Fri, 20 Jan 2012 23:15:43 +0000 Subject: [PATCH] New, extended CAN structures must be packed. git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4320 7fd9a85b-ad96-42d3-883c-3090e2eb8679 --- nuttx/include/nuttx/can.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/nuttx/include/nuttx/can.h b/nuttx/include/nuttx/can.h index 0ad45ed1ea..7fd4bfb155 100644 --- a/nuttx/include/nuttx/can.h +++ b/nuttx/include/nuttx/can.h @@ -41,6 +41,7 @@ ************************************************************************************/ #include +#include #include #include @@ -162,21 +163,21 @@ struct can_hdr_s uint8_t ch_rtr : 1; /* RTR indication */ uint8_t ch_extid : 1; /* Extended ID indication */ uint8_t ch_unused : 2; /* Unused */ -}; +} packed_struct; #else struct can_hdr_s { uint16_t ch_dlc : 4; /* 4-bit DLC */ uint16_t ch_rtr : 1; /* RTR indication */ uint16_t ch_id : 11; /* 11-bit standard ID */ -}; +} packed_struct; #endif struct can_msg_s { struct can_hdr_s cm_hdr; /* The CAN header */ uint8_t cm_data[CAN_MAXDATALEN]; /* CAN message data (0-8 byte) */ -}; +} packed_struct; /* This structure defines a CAN message FIFO. */