From 09e0135ecbf592870bcd236bfc67dd03e54db237 Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Thu, 29 Jul 2021 21:45:51 +0100 Subject: [PATCH] AP_HAL: add accessor for reversed mask allow mask updates to be disabled document mask types define DSHOT_ZERO_THROTTLE --- libraries/AP_HAL/RCOutput.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL/RCOutput.h b/libraries/AP_HAL/RCOutput.h index 3dc12986ac..864d9018ba 100644 --- a/libraries/AP_HAL/RCOutput.h +++ b/libraries/AP_HAL/RCOutput.h @@ -52,22 +52,30 @@ public: /* * mark the channels in chanmask as reversible. This is needed for some ESC types (such as DShot) - * so that output scaling can be performed correctly. The chanmask passed is added (ORed) into - * any existing mask. + * so that output scaling can be performed correctly. The chanmask passed is added (ORed) into any existing mask. + * The mask uses servo channel numbering */ virtual void set_reversible_mask(uint16_t chanmask) {} /* - * mark the channels in chanmask as reversed. The chanmask passed is added (ORed) into - * any existing mask. + * mark the channels in chanmask as reversed. + * The chanmask passed is added (ORed) into any existing mask. + * The mask uses servo channel numbering */ virtual void set_reversed_mask(uint16_t chanmask) {} + virtual uint16_t get_reversed_mask() { return 0; } /* * Update channel masks at 1Hz allowing for actions such as dshot commands to be sent */ virtual void update_channel_masks() {} + /* + * Allow channel mask updates to be temporarily suspended + */ + virtual void disable_channel_mask_updates() {} + virtual void enable_channel_mask_updates() {} + /* * Delay subsequent calls to write() going to the underlying hardware in * order to group related writes together. When all the needed writes are @@ -225,6 +233,8 @@ public: DSHOT_LED3_OFF = 29, }; + const uint8_t DSHOT_ZERO_THROTTLE = 48; + enum DshotEscType { DSHOT_ESC_NONE = 0, DSHOT_ESC_BLHELI = 1