From 7749bfe82c2206b7716c50ebb70bfeb6b64d8deb Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 26 Jul 2014 16:27:16 +0900 Subject: [PATCH] Motors: add get_motor_mask method This returns a bitmask of output channels that are used by the motors library. This allows removing the chance of a do-set-servo interfering with a motor or control surface used to control the vehicle. --- libraries/AP_Motors/AP_Motors_Class.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libraries/AP_Motors/AP_Motors_Class.h b/libraries/AP_Motors/AP_Motors_Class.h index 9101512562..1ea843477c 100644 --- a/libraries/AP_Motors/AP_Motors_Class.h +++ b/libraries/AP_Motors/AP_Motors_Class.h @@ -130,6 +130,10 @@ public: // Note: this must be set immediately before a step up in throttle void slow_start(bool true_false); + // get_motor_mask - returns a bitmask of which outputs are being used for motors (1 means being used) + // this can be used to ensure other pwm outputs (i.e. for servos) do not conflict + virtual uint16_t get_motor_mask() = 0; + // structure for holding motor limit flags struct AP_Motors_limit { uint8_t roll_pitch : 1; // we have reached roll or pitch limit