added mechanism for handling overrun to keep program from getting stuck in UART callback
@@ -120,7 +120,10 @@ void HAL_UART_RxCpltCallback(UART_HandleTypeDef* huart)
{
// TODO:
// Add handling for non-writable, overflow conditions, etc.
+ if (uhandle.queue_rx.writable())
uhandle.queue_rx.Write(uhandle.dma_buffer_rx[i]);
+ else
+ uhandle.queue_rx.Overwrite(uhandle.dma_buffer_rx[i]);
}
}
