Linux 常用技巧
一 、 结构体内存对齐
typedef union
{
#define WJV2_LEN_BITSTR_ALLOWEDMANEUVERS 12
#define WJV2_LEN_BYTE_ALLOWEDMANEUVERS 2
uint8_t u8AllowedManeuvers[WJV2_LEN_BYTE_ALLOWEDMANEUVERS];
struct
{
uint16_t bit_caution : 1;
uint16_t bit_reserved : 5;
};
}__attribute__ ((packed)) WJV2_BIT_AllowedManeuvers; /* 车道允许转向行为 */