#include "CommandsDefine.h" #include "ProjectConfig.h" #include "DS18B20.h" #include "Helper.h" #include "usart.h" ////////////////////////////////////////////////////////////////////////////// // 2203/4/X GHz_ljw 合并版 ////////////////////////////////////////////////////////////////////////////// void CMD0x30_Request_ReadTemperature_process(u8 *pData,u16 dataLen,u8 bIsContentBitInverted_Recv,u8 bIsContentBitInverted_SendBack) { #ifdef RUNNING_WHERE_AT_BOOT Command_SendbackErrorMessage(Error0x02_CannotRunAtBoot); #else u8 dataBytes= 4 * 2; u16 temperature=DS18B20_Get_Temp_CH1; USART_WR_BUF[0]=(temperature>>8)&0x0ff; USART_WR_BUF[1]=temperature&0x0ff; temperature=DS18B20_Get_Temp_CH2; USART_WR_BUF[2]=(temperature>>8)&0x0ff; USART_WR_BUF[3]=temperature&0x0ff; temperature=DS18B20_Get_Temp_CH3; USART_WR_BUF[4]=(temperature>>8)&0x0ff; USART_WR_BUF[5]=temperature&0x0ff; temperature=DS18B20_Get_Temp_CH4; USART_WR_BUF[6]=(temperature>>8)&0x0ff; USART_WR_BUF[7]=temperature&0x0ff; int sendSize=Command_FormatCmdBuffer(CMD0x30_Request_ReadTemperature,USART_WR_BUF,dataBytes,USART_WR_BUF_LAST); USART6_Send(CMD0x30_Request_ReadTemperature,dataBytes,bIsContentBitInverted_SendBack); #endif }