status = MYUARTGets((char*)&char1, 1, timeout); ---->报警告
已经
typedef enum
{
HAL_OK = 0x00U,
HAL_ERROR = 0x01U,
HAL_BUSY = 0x02U,
HAL_TIMEOUT = 0x03U
} HAL_StatusTypeDef;
MYUARTGets 函数
HAL_StatusTypeDef MYUARTGets(char *pRxBuffer, unsigned int numBytesToRead, unsigned int timeOut)
{
unsigned int count = 0;
HAL_StatusTypeDef status = HAL_OK;
unsigned long long Sys_Ticks_Timeout_Ms = Sys_Ticks_Now_Ms+timeOut;
if(numBytesToRead <= 0)
{
status = HAL_ERROR;
return status;
}
while((Sys_Ticks_Now_Ms <= Sys_Ticks_Timeout_Ms) && (count < numBytesToRead))
{
status = HAL_TIMEOUT;
if(TRUE == UARTCharsAvail(SOC_UART_1_REGS))
{
*pRxBuffer = UARTCharGetNonBlocking(SOC_UART_1_REGS);
pRxBuffer++;
count++;
Sys_Ticks_Timeout_Ms = Sys_Ticks_Now_Ms+timeOut;
status = HAL_OK;
}
}
return status;
}
本人看不得 warning
请教各位大佬了~!
status, unsigned, hal_ok, timeout