From 33182a9f1158e9fc99c8a8498201e9f7267205c9 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 1 Jan 2020 15:33:58 +1100 Subject: [PATCH] AP_RCProtocol: use RC_OPTIONS fport pad option --- libraries/AP_RCProtocol/AP_RCProtocol_FPort.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/libraries/AP_RCProtocol/AP_RCProtocol_FPort.cpp b/libraries/AP_RCProtocol/AP_RCProtocol_FPort.cpp index 1623c95e04..1232e3d779 100644 --- a/libraries/AP_RCProtocol/AP_RCProtocol_FPort.cpp +++ b/libraries/AP_RCProtocol/AP_RCProtocol_FPort.cpp @@ -20,6 +20,8 @@ #include "AP_RCProtocol_FPort.h" #include #include +#include +#include extern const AP_HAL::HAL& hal; @@ -183,7 +185,15 @@ void AP_RCProtocol_FPort::decode_downlink(const FPort_Frame &frame) // perform byte stuffing per FPort spec uint8_t len = 0; - uint8_t buf2[sizeof(buf)*2]; + uint8_t buf2[sizeof(buf)*2+1]; + +#if !APM_BUILD_TYPE(APM_BUILD_iofirmware) + if (rc().fport_pad()) { + // this padding helps on some uarts that have hw pullups + buf2[len++] = 0xff; + } +#endif + for (uint8_t i=0; i