From ad6355c0290798a03d0f83d7442f2c32cf5a4439 Mon Sep 17 00:00:00 2001 From: Mingchen Zhang Date: Sun, 10 Oct 2021 00:07:42 -0700 Subject: [PATCH] Add * to the end of flight mode string in CRSF --- libraries/AP_RCTelemetry/AP_CRSF_Telem.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libraries/AP_RCTelemetry/AP_CRSF_Telem.cpp b/libraries/AP_RCTelemetry/AP_CRSF_Telem.cpp index d2c3b634a4..36260f8fb6 100644 --- a/libraries/AP_RCTelemetry/AP_CRSF_Telem.cpp +++ b/libraries/AP_RCTelemetry/AP_CRSF_Telem.cpp @@ -916,7 +916,13 @@ void AP_CRSF_Telem::calc_flight_mode() AP_Notify * notify = AP_Notify::get_singleton(); if (notify) { // Note: snprintf() always terminates the string - hal.util->snprintf(_telem.bcast.flightmode.flight_mode, sizeof(AP_CRSF_Telem::FlightModeFrame), "%s", notify->get_flight_mode_str()); + hal.util->snprintf( + _telem.bcast.flightmode.flight_mode, + sizeof(AP_CRSF_Telem::FlightModeFrame), + "%s%s", + notify->get_flight_mode_str(), + hal.util->get_soft_armed() ? "" : "*" + ); // Note: strlen(_telem.bcast.flightmode.flight_mode) is safe because called on a guaranteed null terminated string _telem_size = strlen(_telem.bcast.flightmode.flight_mode) + 1; //send the terminator as well _telem_type = AP_RCProtocol_CRSF::CRSF_FRAMETYPE_FLIGHT_MODE;