TI中文支持网
TI专业的中文技术问题搜集分享网站

FLOAT转换为整数,用联合体转换,错误 incomplete type is not allowed

typedef struct ADC_SAMPLE
{
Uint16 buffer[240];
Uint16 ADC_SAMPLETIMES;
Uint16 ADC_CHANNEL_NUM;
float AD_Sample_InitValue0;
float AD_Sample_InitValue1;
float AD_Sample_InitValue2;
float AD_Sample_InitValue3;
float AD_Sample_InitValue4;
float AD_Sample_InitValue5;
float AD_Sample_InitValue6;
float AD_Sample_InitValue7;
float AD_Sample_InitValue8;
float AD_Sample_InitValue9;
float AD_Sample_InitValue10;
float AD_Sample_InitValue11;
float AD_Value0;
float AD_Value1;
float AD_Value2;
float AD_Value3;
float AD_Value4;
float AD_Value5;
float AD_Value6;
float AD_Value7;
float AD_Value8;
float AD_Value9;
float AD_Value10;
float AD_Value11;
union sampleresult AD_SampleResult;
union abnormal_status Recorder_AbnormalStatus;
union floatConvert AD_Float;
} ADCSAMPLE;

union floatConvert
{
struct
{
Uint16 word0;
Uint16 word1;
}FloattoWord;
float value;
};

Seven Han:

您把uion整体放到结构体里。

赞(0)
未经允许不得转载:TI中文支持网 » FLOAT转换为整数,用联合体转换,错误 incomplete type is not allowed
分享到: 更多 (0)