From 6b106c401c4de48d9eeb16c1bc7b15013d5c7a73 Mon Sep 17 00:00:00 2001 From: Iampete1 Date: Sun, 18 Jun 2023 20:01:27 +0100 Subject: [PATCH] Plane: Quadplane: check with motors if motor test is allowed --- ArduPlane/motor_test.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ArduPlane/motor_test.cpp b/ArduPlane/motor_test.cpp index cfc640cab9..67dee708b5 100644 --- a/ArduPlane/motor_test.cpp +++ b/ArduPlane/motor_test.cpp @@ -87,6 +87,14 @@ MAV_RESULT QuadPlane::mavlink_motor_test_start(mavlink_channel_t chan, uint8_t m gcs().send_text(MAV_SEVERITY_INFO, "Must be disarmed for motor test"); return MAV_RESULT_FAILED; } + + // Check Motor test is allowed + char failure_msg[50] {}; + if (!motors->motor_test_checks(ARRAY_SIZE(failure_msg), failure_msg)) { + gcs().send_text(MAV_SEVERITY_CRITICAL,"Motor Test: %s", failure_msg); + return MAV_RESULT_FAILED; + } + // if test has not started try to start it if (!motor_test.running) { // start test