Commit 35e7484b authored by Richard Miller's avatar Richard Miller

Clear uart input overrun before starting to read in interrupt mode.

parent 966d1535
......@@ -124,6 +124,7 @@ uart_startread(void)
{
int err;
__HAL_UART_CLEAR_IT(&huart1, UART_CLEAR_OREF);
err = HAL_UART_Receive_IT(&huart1, &uartbyte, 1);
if (err != OK)
uart_puts("HAL_UART_Receive_IT failed!\n");
......@@ -136,7 +137,7 @@ void
HAL_UART_RxCpltCallback(UART_HandleTypeDef *huart)
{
fifo_put(&uart_fifo, uartbyte);
uart_startread();
HAL_UART_Receive_IT(huart, &uartbyte, 1);
}
/*
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment