有个错误弄不明白
if (eight_to_24(USART0_Receive(),USART0_Receive(),USART0_Receive())== E_pc_write_cpu)finish_report(write_cpu);//接收结束指令,发送完成报告
else ERROR_handle(end_error);//没有接收到结束指令,发送错误报告
warning:comparison is always false due to limited range of data type
这是为什么?
相关的程序在下面:
定义一个函数,分成两个8位传送16位的数据
long eight_to_24(unsigned char eight_high,unsigned char eight_mid,unsigned char eight_low)//将数据的低位和高位传进函数
{
unsigned long high=0;
unsigned int mid=0;
high=(long)eight_high;
mid=(int)eight_mid;
return(eight_low+(eight_mid<<8)+(high<<16)); //返回组合好后的数值
}
unsigned char USART0_Receive( void )
{
return (0x34);
}