mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-27 02:06:27 +08:00
New, extended CAN structures must be packed.
git-svn-id: https://nuttx.svn.sourceforge.net/svnroot/nuttx/trunk@4320 7fd9a85b-ad96-42d3-883c-3090e2eb8679
This commit is contained in:
@@ -41,6 +41,7 @@
|
|||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
#include <nuttx/compiler.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
@@ -162,21 +163,21 @@ struct can_hdr_s
|
|||||||
uint8_t ch_rtr : 1; /* RTR indication */
|
uint8_t ch_rtr : 1; /* RTR indication */
|
||||||
uint8_t ch_extid : 1; /* Extended ID indication */
|
uint8_t ch_extid : 1; /* Extended ID indication */
|
||||||
uint8_t ch_unused : 2; /* Unused */
|
uint8_t ch_unused : 2; /* Unused */
|
||||||
};
|
} packed_struct;
|
||||||
#else
|
#else
|
||||||
struct can_hdr_s
|
struct can_hdr_s
|
||||||
{
|
{
|
||||||
uint16_t ch_dlc : 4; /* 4-bit DLC */
|
uint16_t ch_dlc : 4; /* 4-bit DLC */
|
||||||
uint16_t ch_rtr : 1; /* RTR indication */
|
uint16_t ch_rtr : 1; /* RTR indication */
|
||||||
uint16_t ch_id : 11; /* 11-bit standard ID */
|
uint16_t ch_id : 11; /* 11-bit standard ID */
|
||||||
};
|
} packed_struct;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
struct can_msg_s
|
struct can_msg_s
|
||||||
{
|
{
|
||||||
struct can_hdr_s cm_hdr; /* The CAN header */
|
struct can_hdr_s cm_hdr; /* The CAN header */
|
||||||
uint8_t cm_data[CAN_MAXDATALEN]; /* CAN message data (0-8 byte) */
|
uint8_t cm_data[CAN_MAXDATALEN]; /* CAN message data (0-8 byte) */
|
||||||
};
|
} packed_struct;
|
||||||
|
|
||||||
/* This structure defines a CAN message FIFO. */
|
/* This structure defines a CAN message FIFO. */
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user