mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-22 07:44:03 -04:00
AP_BLHeli: keep a record of disabled motors
This commit is contained in:
parent
9549d2df93
commit
a673a481fd
@ -485,6 +485,7 @@ void AP_BLHeli::msp_process_command(void)
|
|||||||
// set the output to each motor
|
// set the output to each motor
|
||||||
uint8_t nmotors = msp.dataSize / 2;
|
uint8_t nmotors = msp.dataSize / 2;
|
||||||
debug("MSP_SET_MOTOR %u", nmotors);
|
debug("MSP_SET_MOTOR %u", nmotors);
|
||||||
|
motors_disabled_mask = SRV_Channels::get_disabled_channel_mask();
|
||||||
SRV_Channels::set_disabled_channel_mask(0xFFFF);
|
SRV_Channels::set_disabled_channel_mask(0xFFFF);
|
||||||
motors_disabled = true;
|
motors_disabled = true;
|
||||||
EXPECT_DELAY_MS(1000);
|
EXPECT_DELAY_MS(1000);
|
||||||
@ -946,7 +947,7 @@ void AP_BLHeli::blheli_process_command(void)
|
|||||||
serial_start_ms = 0;
|
serial_start_ms = 0;
|
||||||
if (motors_disabled) {
|
if (motors_disabled) {
|
||||||
motors_disabled = false;
|
motors_disabled = false;
|
||||||
SRV_Channels::set_disabled_channel_mask(0);
|
SRV_Channels::set_disabled_channel_mask(motors_disabled_mask);
|
||||||
}
|
}
|
||||||
if (uart_locked) {
|
if (uart_locked) {
|
||||||
debug("Unlocked UART");
|
debug("Unlocked UART");
|
||||||
@ -1244,7 +1245,7 @@ void AP_BLHeli::run_connection_test(uint8_t chan)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
hal.rcout->serial_end();
|
hal.rcout->serial_end();
|
||||||
SRV_Channels::set_disabled_channel_mask(0);
|
SRV_Channels::set_disabled_channel_mask(motors_disabled_mask);
|
||||||
motors_disabled = false;
|
motors_disabled = false;
|
||||||
serial_start_ms = 0;
|
serial_start_ms = 0;
|
||||||
blheli.chan = saved_chan;
|
blheli.chan = saved_chan;
|
||||||
@ -1277,7 +1278,7 @@ void AP_BLHeli::update(void)
|
|||||||
}
|
}
|
||||||
if (motors_disabled) {
|
if (motors_disabled) {
|
||||||
motors_disabled = false;
|
motors_disabled = false;
|
||||||
SRV_Channels::set_disabled_channel_mask(0);
|
SRV_Channels::set_disabled_channel_mask(motors_disabled_mask);
|
||||||
}
|
}
|
||||||
if (uart != nullptr) {
|
if (uart != nullptr) {
|
||||||
debug("Unlocked UART");
|
debug("Unlocked UART");
|
||||||
|
@ -231,6 +231,8 @@ private:
|
|||||||
|
|
||||||
// have we disabled motor outputs?
|
// have we disabled motor outputs?
|
||||||
bool motors_disabled;
|
bool motors_disabled;
|
||||||
|
// mask of channels that should normally be disabled
|
||||||
|
uint16_t motors_disabled_mask;
|
||||||
|
|
||||||
// have we locked the UART?
|
// have we locked the UART?
|
||||||
bool uart_locked;
|
bool uart_locked;
|
||||||
|
Loading…
Reference in New Issue
Block a user