HAL_ChibiOS: fixed RTSCTS flow control issue

this fixes an issue reported on MatekH743, but also applies to other
boards. When not using DMA if there have been bytes written before the
auto flow control detection was enabled then these must be cleared
from _total_written so the flow control detection can work correctly
This commit is contained in:
Andrew Tridgell 2021-09-13 18:45:25 +10:00
parent 4bf32a5fb7
commit 564ea5e521

View File

@ -1093,6 +1093,7 @@ void UARTDriver::write_pending_bytes(void)
if (_flow_control == FLOW_CONTROL_AUTO) {
if (_first_write_started_us == 0) {
_first_write_started_us = AP_HAL::micros();
_total_written = 0;
}
#ifndef HAL_UART_NODMA
if (tx_dma_enabled) {