添加串口中断回调函数:void HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
UserTxBufPtrIn++;
if(UserTxBufPtrIn == APP_RX_DATA_SIZE)//防止溢出
{
UserTxBufPtrIn = 0;
}
UR_Tick = 0;//接收计时器清零
UR_Flag = 1;//正在接收
HAL_UART_Receive_IT(huart, (uint8_t *)(UserTxBufferFS + UserTxBufPtrIn), 1);
}
|