CCS 中如何实现结构体内存对齐,就像VS 中的 #pragma pack(1) 语句????????
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
CCS 中如何实现结构体内存对齐,就像VS 中的 #pragma pack(1) 语句????????
Dear Terry Deng:
你好,我是想在CCS 中实现 #pragma pack(1) 命令(即 设置结构体的边界对齐为1个字节,也就是所有数据在内存中是连续存储的)
如声明下列结构体。
#pragma pack(1)
#define mPACKET
// 基础参数设置对象
typedef struct _BasePara_Obj_
{
int_least8_t MotorFamily;
int_least8_t MotorType;
int_least8_t Commutation;
int_least8_t HallType;
int_least8_t MotorFeedBack;
int_least8_t LoadFeedBack;
int_least8_t LoadFeedBackMode;
}mPACKET BasePara_Obj;
但在 CCS 中似乎不支持#pragma pack(1) 预处理指令,出现 #163-D unrecognized #pragma warning ,请问如何处理呢??