From ca477d09ed673f8e5a20ce0ebeacc67a9fdaf25f Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Thu, 15 Jul 2021 19:21:54 +0100 Subject: [PATCH] AP_BLHeli: ensure correct rotation through telemetry ESCs --- libraries/AP_BLHeli/AP_BLHeli.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_BLHeli/AP_BLHeli.cpp b/libraries/AP_BLHeli/AP_BLHeli.cpp index 4c2cbccfe8..883ee7750f 100644 --- a/libraries/AP_BLHeli/AP_BLHeli.cpp +++ b/libraries/AP_BLHeli/AP_BLHeli.cpp @@ -1495,7 +1495,7 @@ void AP_BLHeli::log_bidir_telemetry(void) // ask the next ESC for telemetry uint8_t idx_pos = last_telem_esc; uint8_t idx = (idx_pos + 1) % num_motors; - for (; idx != idx_pos; idx = (idx_pos + 1) % num_motors) { + for (; idx != idx_pos; idx = (idx + 1) % num_motors) { if (SRV_Channels::have_digital_outputs(1U << motor_map[idx])) { break; } @@ -1564,7 +1564,7 @@ void AP_BLHeli::update_telemetry(void) // ask the next ESC for telemetry uint8_t idx_pos = last_telem_esc; uint8_t idx = (idx_pos + 1) % num_motors; - for (; idx != idx_pos; idx = (idx_pos + 1) % num_motors) { + for (; idx != idx_pos; idx = (idx + 1) % num_motors) { if (SRV_Channels::have_digital_outputs(1U << motor_map[idx])) { break; }