From 2d023967dc481265069d9b5e4e0d70318be0109c Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Wed, 25 Aug 2021 12:04:50 +1000 Subject: [PATCH] ArduCopter: make bad-mode-number notification consistent across vehicles --- ArduCopter/mode.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ArduCopter/mode.cpp b/ArduCopter/mode.cpp index 5f41f73c3f849..b4022aea9fd5b 100644 --- a/ArduCopter/mode.cpp +++ b/ArduCopter/mode.cpp @@ -221,10 +221,9 @@ bool Copter::set_mode(Mode::Number mode, ModeReason reason) } #endif - Mode *new_flightmode = mode_from_mode_num((Mode::Number)mode); + Mode *new_flightmode = mode_from_mode_num(mode); if (new_flightmode == nullptr) { - gcs().send_text(MAV_SEVERITY_WARNING,"No such mode"); - AP::logger().Write_Error(LogErrorSubsystem::FLIGHT_MODE, LogErrorCode(mode)); + notify_no_such_mode((uint8_t)mode); return false; }