From fc675a1e4aab98ff5c54e8ab417bdec9390ccd70 Mon Sep 17 00:00:00 2001 From: Randy Mackay Date: Sat, 15 Apr 2017 09:53:17 +0900 Subject: [PATCH] Copter: do not allow motor test before initialisation completes --- ArduCopter/motor_test.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ArduCopter/motor_test.cpp b/ArduCopter/motor_test.cpp index 920187d6e7..3793e6bcda 100644 --- a/ArduCopter/motor_test.cpp +++ b/ArduCopter/motor_test.cpp @@ -72,6 +72,12 @@ void Copter::motor_test_output() // return true if tests can continue, false if not bool Copter::mavlink_motor_test_check(mavlink_channel_t chan, bool check_rc) { + // check board has initialised + if (!ap.initialised) { + gcs_chan[chan-MAVLINK_COMM_0].send_text(MAV_SEVERITY_CRITICAL,"Motor Test: Board initialising"); + return false; + } + // check rc has been calibrated arming.pre_arm_rc_checks(true); if(check_rc && !ap.pre_arm_rc_check) {