From dd8115c9b4f99a89feef455d16b2b141b36ee253 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sun, 10 Feb 2019 21:05:23 +1100 Subject: [PATCH] HAL_ChibiOS: check for already allocated TX dma in UART driver --- libraries/AP_HAL_ChibiOS/UARTDriver.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp index 6fbdcc618b..fb50d22eca 100644 --- a/libraries/AP_HAL_ChibiOS/UARTDriver.cpp +++ b/libraries/AP_HAL_ChibiOS/UARTDriver.cpp @@ -314,7 +314,9 @@ void UARTDriver::begin(uint32_t b, uint16_t rxS, uint16_t txS) void UARTDriver::dma_tx_allocate(Shared_DMA *ctx) { #if HAL_USE_SERIAL == TRUE - osalDbgAssert(txdma == nullptr, "double DMA allocation"); + if (txdma != nullptr) { + return; + } chSysLock(); txdma = dmaStreamAllocI(sdef.dma_tx_stream_id, 12, //IRQ Priority