AP_BLHeli: allow for no uart in update()

This commit is contained in:
Andrew Tridgell 2021-12-09 07:11:04 +11:00 committed by Tom Pittenger
parent 9359f39e30
commit 604f2430f8
1 changed files with 5 additions and 3 deletions

View File

@ -1260,9 +1260,11 @@ void AP_BLHeli::update(void)
motors_disabled = false;
SRV_Channels::set_disabled_channel_mask(0);
}
debug("Unlocked UART");
uart->lock_port(0, 0);
uart_locked = false;
if (uart != nullptr) {
debug("Unlocked UART");
uart->lock_port(0, 0);
uart_locked = false;
}
if (motor_control_active) {
for (uint8_t i = 0; i < num_motors; i++) {
bool reversed = ((1U<<motor_map[i]) & channel_reversible_mask.get()) != 0;