From 26ced02cd186175a3430f39b8d2ee67ffe0e0e23 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 17 Jan 2020 15:57:36 +1100 Subject: [PATCH] HAL_ChibiOS: don't extend alloc of iomcu uart --- libraries/AP_HAL_ChibiOS/UARTDriver.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp index 62a9946adf..3d5489d0e0 100644 --- a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp +++ b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp @@ -152,7 +152,18 @@ void UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS) of data. Assumes 10 bits per byte, which is normal for most protocols */ - min_rx_buffer = MAX(min_rx_buffer, b/(40*10)); + bool rx_size_by_baudrate = true; +#if HAL_WITH_IO_MCU + if (this == &uart_io) { + // iomcu doesn't need extra space, just speed + rx_size_by_baudrate = false; + min_tx_buffer = 0; + min_rx_buffer = 0; + } +#endif + if (rx_size_by_baudrate) { + min_rx_buffer = MAX(min_rx_buffer, b/(40*10)); + } if (sdef.is_usb) { // give more buffer space for log download on USB