From f3179e7934f70158d19a261c1529cafb83ccc156 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Tue, 22 May 2018 16:11:45 +1000 Subject: [PATCH] HAL_ChibiOS: improved reliability of DShot passthru thanks to WickedShell for debugging this on his Wraith32 ESCs. We were truncating the last bit on some BLHeli transfers --- libraries/AP_HAL_ChibiOS/RCOutput.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_ChibiOS/RCOutput.cpp b/libraries/AP_HAL_ChibiOS/RCOutput.cpp index be398c750b..5625a58a12 100644 --- a/libraries/AP_HAL_ChibiOS/RCOutput.cpp +++ b/libraries/AP_HAL_ChibiOS/RCOutput.cpp @@ -1093,10 +1093,12 @@ bool RCOutput::serial_write_bytes(const uint8_t *bytes, uint16_t len) return false; } } - serial_group->dma_handle->unlock(); + // add a small delay for last word of output to have completely // finished - hal.scheduler->delay_microseconds(10); + hal.scheduler->delay_microseconds(25); + + serial_group->dma_handle->unlock(); return true; }