Copter: make sure takeoff check checks the right ESC channels

This commit is contained in:
Andy Piper 2023-11-10 18:05:41 +00:00 committed by Andrew Tridgell
parent b44b804bcf
commit 452ec19679
1 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,12 @@ void Copter::takeoff_check()
// check ESCs are sending RPM at expected level // check ESCs are sending RPM at expected level
uint32_t motor_mask = motors->get_motor_mask(); uint32_t motor_mask = motors->get_motor_mask();
#if HAL_WITH_IO_MCU
if (AP_BoardConfig::io_enabled()) {
// In 4.4 and earlier ESC telemetry is always indexed from 1 for servo channels 9+
motor_mask >>= 8;
}
#endif
const bool telem_active = AP::esc_telem().is_telemetry_active(motor_mask); const bool telem_active = AP::esc_telem().is_telemetry_active(motor_mask);
const bool rpm_adequate = AP::esc_telem().are_motors_running(motor_mask, g2.takeoff_rpm_min); const bool rpm_adequate = AP::esc_telem().are_motors_running(motor_mask, g2.takeoff_rpm_min);