From ba8cb8f198e2e481b8b964da343176f251676dd6 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Tue, 22 Mar 2022 20:05:22 +0900 Subject: [PATCH] AP_HAL_ChibiOS: reversible DShot fix Co-authored-by: Andy Piper --- libraries/AP_HAL_ChibiOS/RCOutput.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_HAL_ChibiOS/RCOutput.cpp b/libraries/AP_HAL_ChibiOS/RCOutput.cpp index ad8a586105..f2db63ba94 100644 --- a/libraries/AP_HAL_ChibiOS/RCOutput.cpp +++ b/libraries/AP_HAL_ChibiOS/RCOutput.cpp @@ -1404,7 +1404,7 @@ void RCOutput::dshot_send(pwm_group &group, uint32_t time_out_us) pwm = constrain_int16(pwm, 1000, 2000); uint16_t value = MIN(2 * (pwm - 1000), 1999); - if (chan_mask & (_reversible_mask>>chan_offset)) { + if ((chan_mask & _reversible_mask) != 0) { // this is a DShot-3D output, map so that 1500 PWM is zero throttle reversed if (value < 1000) { value = 1999 - value;