From 6f704b3818812725c914a25f09cba8893790aadc Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 2 Apr 2018 16:16:37 +1000 Subject: [PATCH] AP_BLHeli: fixed use of SERVO_BLH_AUTO --- libraries/AP_BLHeli/AP_BLHeli.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/AP_BLHeli/AP_BLHeli.cpp b/libraries/AP_BLHeli/AP_BLHeli.cpp index 7a2464eafb..d887d8d50a 100644 --- a/libraries/AP_BLHeli/AP_BLHeli.cpp +++ b/libraries/AP_BLHeli/AP_BLHeli.cpp @@ -409,7 +409,7 @@ void AP_BLHeli::msp_process_command(void) msp.escMode = (enum escProtocol)msp.buf[0]; msp.portIndex = msp.buf[1]; } - debug("escMode=%u portIndex=%u", msp.escMode, msp.portIndex); + debug("escMode=%u portIndex=%u num_motors=%u", msp.escMode, msp.portIndex, num_motors); uint8_t n = num_motors; switch (msp.escMode) { case PROTOCOL_4WAY: @@ -1128,9 +1128,11 @@ void AP_BLHeli::update(void) /* plane and copter can use AP_Motors to get an automatic mask */ - AP_Motors *motors = AP_Motors::get_instance(); - if (motors) { - mask |= motors->get_motor_mask(); + if (channel_auto.get() == 1) { + AP_Motors *motors = AP_Motors::get_instance(); + if (motors) { + mask |= motors->get_motor_mask(); + } } #endif