@@ -6137,10 +6137,10 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
61376137 /* WARNING: messageBuf is shared, use accordingly */
61386138 char messageBuf [MAX (SETTING_MAX_NAME_LENGTH , OSD_MESSAGE_LENGTH + 1 )];
61396139
6140- /* WARNING: ensure number of messages returned does not exceed messages array size
6141- * Messages array set 1 larger than maximum expected message count of 6 */
6140+ /* Messages array - use ADD_MSG() for bounds-safe access. */
61426141 const char * messages [7 ];
61436142 unsigned messageCount = 0 ;
6143+ #define ADD_MSG (msg ) if (messageCount < ARRAYLEN(messages)) messages[messageCount++] = (msg)
61446144
61456145 const char * failsafeInfoMessage = NULL ;
61466146 const char * invertedInfoMessage = NULL ;
@@ -6149,16 +6149,16 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
61496149 if (FLIGHT_MODE (FAILSAFE_MODE ) || FLIGHT_MODE (NAV_RTH_MODE ) || FLIGHT_MODE (NAV_WP_MODE ) || navigationIsExecutingAnEmergencyLanding ()) {
61506150 /* ADDS MAXIMUM OF 3 MESSAGES TO TOTAL NORMALLY, 5 MESSAGES DURING FAILSAFE */
61516151 if (navGetCurrentStateFlags () & NAV_AUTO_WP_DONE ) {
6152- messages [ messageCount ++ ] = STATE (LANDING_DETECTED ) ? OSD_MESSAGE_STR (OSD_MSG_WP_LANDED ) : OSD_MESSAGE_STR (OSD_MSG_WP_FINISHED );
6152+ ADD_MSG ( STATE (LANDING_DETECTED ) ? OSD_MESSAGE_STR (OSD_MSG_WP_LANDED ) : OSD_MESSAGE_STR (OSD_MSG_WP_FINISHED ) );
61536153 } else if (NAV_Status .state == MW_NAV_STATE_WP_ENROUTE ) {
61546154 // Countdown display for remaining Waypoints
61556155 char buf [6 ];
61566156 osdFormatDistanceSymbol (buf , posControl .wpDistance , 0 , 3 );
61576157 tfp_sprintf (messageBuf , "TO WP %u/%u (%s)" , getGeoWaypointNumber (posControl .activeWaypointIndex ), posControl .geoWaypointCount , buf );
6158- messages [ messageCount ++ ] = messageBuf ;
6158+ ADD_MSG ( messageBuf ) ;
61596159 } else if (NAV_Status .state == MW_NAV_STATE_HOLD_TIMED ) {
61606160 if (navConfig ()-> general .waypoint_enforce_altitude && !posControl .wpAltitudeReached ) {
6161- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_ADJUSTING_WP_ALT );
6161+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_ADJUSTING_WP_ALT ) );
61626162 } else {
61636163 // WP hold time countdown in seconds
61646164 timeMs_t currentTime = millis ();
@@ -6167,64 +6167,64 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
61676167
61686168 tfp_sprintf (messageBuf , "HOLDING WP FOR %2u S" , holdTimeRemaining );
61696169
6170- messages [ messageCount ++ ] = messageBuf ;
6170+ ADD_MSG ( messageBuf ) ;
61716171 }
61726172 }
61736173 else {
61746174 const char * navStateMessage = navigationStateMessage ();
61756175 if (navStateMessage ) {
6176- messages [ messageCount ++ ] = navStateMessage ;
6176+ ADD_MSG ( navStateMessage ) ;
61776177 }
61786178 }
61796179#if defined(USE_SAFE_HOME )
61806180 const char * safehomeMessage = divertingToSafehomeMessage ();
61816181 if (safehomeMessage ) {
6182- messages [ messageCount ++ ] = safehomeMessage ;
6182+ ADD_MSG ( safehomeMessage ) ;
61836183 }
61846184#endif
61856185
61866186#ifdef USE_GEOZONE
61876187 if (geozone .avoidInRTHInProgress ) {
6188- messages [ messageCount ++ ] = OSD_MSG_AVOID_ZONES_RTH ;
6188+ ADD_MSG ( OSD_MSG_AVOID_ZONES_RTH ) ;
61896189 }
61906190#endif
61916191 if (FLIGHT_MODE (FAILSAFE_MODE )) { // In FS mode while armed
61926192 if (NAV_Status .state == MW_NAV_STATE_LAND_SETTLE && posControl .landingDelay > 0 ) {
61936193 uint16_t remainingHoldSec = MS2S (posControl .landingDelay - millis ());
61946194 tfp_sprintf (messageBuf , "LANDING DELAY: %3u SECONDS" , remainingHoldSec );
61956195
6196- messages [ messageCount ++ ] = messageBuf ;
6196+ ADD_MSG ( messageBuf ) ;
61976197 }
61986198
61996199 const char * failsafePhaseMessage = osdFailsafePhaseMessage ();
62006200 failsafeInfoMessage = osdFailsafeInfoMessage ();
62016201
62026202 if (failsafePhaseMessage ) {
6203- messages [ messageCount ++ ] = failsafePhaseMessage ;
6203+ ADD_MSG ( failsafePhaseMessage ) ;
62046204 }
62056205 if (failsafeInfoMessage ) {
6206- messages [ messageCount ++ ] = failsafeInfoMessage ;
6206+ ADD_MSG ( failsafeInfoMessage ) ;
62076207 }
62086208 } else if (isWaypointMissionRTHActive ()) {
62096209 // if RTH activated whilst WP mode selected, remind pilot to cancel WP mode to exit RTH
6210- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_WP_RTH_CANCEL );
6210+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_WP_RTH_CANCEL ) );
62116211 }
62126212 } else if (STATE (LANDING_DETECTED )) {
6213- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_LANDED );
6213+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_LANDED ) );
62146214 } else {
62156215#ifdef USE_GEOZONE
62166216 char buf [12 ], buf1 [12 ];
62176217 switch (geozone .messageState ) {
62186218 case GEOZONE_MESSAGE_STATE_NFZ :
6219- messages [ messageCount ++ ] = OSD_MSG_NFZ ;
6219+ ADD_MSG ( OSD_MSG_NFZ ) ;
62206220 break ;
62216221 case GEOZONE_MESSAGE_STATE_LEAVING_FZ :
62226222 osdFormatDistanceSymbol (buf , geozone .distanceToZoneBorder3d , 0 , 3 );
62236223 tfp_sprintf (messageBuf , OSD_MSG_LEAVING_FZ , buf );
6224- messages [ messageCount ++ ] = messageBuf ;
6224+ ADD_MSG ( messageBuf ) ;
62256225 break ;
62266226 case GEOZONE_MESSAGE_STATE_OUTSIDE_FZ :
6227- messages [ messageCount ++ ] = OSD_MSG_OUTSIDE_FZ ;
6227+ ADD_MSG ( OSD_MSG_OUTSIDE_FZ ) ;
62286228 break ;
62296229 case GEOZONE_MESSAGE_STATE_ENTERING_NFZ :
62306230 osdFormatDistanceSymbol (buf , geozone .distanceToZoneBorder3d , 0 , 3 );
@@ -6234,36 +6234,36 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
62346234 osdFormatAltitudeSymbol (buf1 , geozone .zoneInfo );
62356235 }
62366236 tfp_sprintf (messageBuf , OSD_MSG_ENTERING_NFZ , buf , buf1 );
6237- messages [ messageCount ++ ] = messageBuf ;
6237+ ADD_MSG ( messageBuf ) ;
62386238 break ;
62396239 case GEOZONE_MESSAGE_STATE_AVOIDING_FB :
6240- messages [ messageCount ++ ] = OSD_MSG_AVOIDING_FB ;
6240+ ADD_MSG ( OSD_MSG_AVOIDING_FB ) ;
62416241 if (!posControl .sendTo .lockSticks ) {
6242- messages [ messageCount ++ ] = OSD_MSG_MOVE_STICKS ;
6242+ ADD_MSG ( OSD_MSG_MOVE_STICKS ) ;
62436243 }
62446244 break ;
62456245 case GEOZONE_MESSAGE_STATE_RETURN_TO_ZONE :
6246- messages [ messageCount ++ ] = OSD_MSG_RETURN_TO_ZONE ;
6246+ ADD_MSG ( OSD_MSG_RETURN_TO_ZONE ) ;
62476247 if (!posControl .sendTo .lockSticks ) {
6248- messages [ messageCount ++ ] = OSD_MSG_MOVE_STICKS ;
6248+ ADD_MSG ( OSD_MSG_MOVE_STICKS ) ;
62496249 }
62506250 break ;
62516251 case GEOZONE_MESSAGE_STATE_AVOIDING_ALTITUDE_BREACH :
6252- messages [ messageCount ++ ] = OSD_MSG_AVOIDING_ALT_BREACH ;
6252+ ADD_MSG ( OSD_MSG_AVOIDING_ALT_BREACH ) ;
62536253 if (!posControl .sendTo .lockSticks ) {
6254- messages [ messageCount ++ ] = OSD_MSG_MOVE_STICKS ;
6254+ ADD_MSG ( OSD_MSG_MOVE_STICKS ) ;
62556255 }
62566256 break ;
62576257 case GEOZONE_MESSAGE_STATE_FLYOUT_NFZ :
6258- messages [ messageCount ++ ] = OSD_MSG_FLYOUT_NFZ ;
6258+ ADD_MSG ( OSD_MSG_FLYOUT_NFZ ) ;
62596259 if (!posControl .sendTo .lockSticks ) {
6260- messages [ messageCount ++ ] = OSD_MSG_MOVE_STICKS ;
6260+ ADD_MSG ( OSD_MSG_MOVE_STICKS ) ;
62616261 }
62626262 break ;
62636263 case GEOZONE_MESSAGE_STATE_POS_HOLD :
6264- messages [ messageCount ++ ] = OSD_MSG_AVOIDING_FB ;
6264+ ADD_MSG ( OSD_MSG_AVOIDING_FB ) ;
62656265 if (!geozone .sticksLocked ) {
6266- messages [ messageCount ++ ] = OSD_MSG_MOVE_STICKS ;
6266+ ADD_MSG ( OSD_MSG_MOVE_STICKS ) ;
62676267 }
62686268 break ;
62696269 case GEOZONE_MESSAGE_STATE_NONE :
@@ -6275,37 +6275,37 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
62756275 if (STATE (AIRPLANE )) { /* ADDS MAXIMUM OF 3 MESSAGES TO TOTAL */
62766276#ifdef USE_FW_AUTOLAND
62776277 if (canFwLandingBeCancelled ()) {
6278- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_MOVE_STICKS );
6278+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_MOVE_STICKS ) );
62796279 } else
62806280#endif
62816281 if (navGetCurrentStateFlags () & NAV_CTL_LAUNCH ) {
6282- messages [ messageCount ++ ] = navConfig ()-> fw .launch_manual_throttle ? OSD_MESSAGE_STR (OSD_MSG_AUTOLAUNCH_MANUAL ) :
6283- OSD_MESSAGE_STR (OSD_MSG_AUTOLAUNCH );
6282+ ADD_MSG ( navConfig ()-> fw .launch_manual_throttle ? OSD_MESSAGE_STR (OSD_MSG_AUTOLAUNCH_MANUAL ) :
6283+ OSD_MESSAGE_STR (OSD_MSG_AUTOLAUNCH )) ;
62846284 const char * launchStateMessage = fixedWingLaunchStateMessage ();
62856285 if (launchStateMessage ) {
6286- messages [ messageCount ++ ] = launchStateMessage ;
6286+ ADD_MSG ( launchStateMessage ) ;
62876287 }
62886288 } else if (FLIGHT_MODE (SOARING_MODE )) {
6289- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_NAV_SOARING );
6289+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_NAV_SOARING ) );
62906290 } else if (isFwAutoModeActive (BOXAUTOTUNE )) {
6291- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_AUTOTUNE );
6291+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_AUTOTUNE ) );
62926292 if (FLIGHT_MODE (MANUAL_MODE )) {
6293- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_AUTOTUNE_ACRO );
6293+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_AUTOTUNE_ACRO ) );
62946294 }
62956295 } else if (isFwAutoModeActive (BOXAUTOTRIM ) && !feature (FEATURE_FW_AUTOTRIM )) {
6296- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_AUTOTRIM );
6296+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_AUTOTRIM ) );
62976297 } else if (isFixedWingLevelTrimActive ()) {
6298- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_AUTOLEVEL );
6298+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_AUTOLEVEL ) );
62996299 }
63006300
63016301 if (IS_RC_MODE_ACTIVE (BOXANGLEHOLD )) {
63026302 int8_t navAngleHoldAxis = navCheckActiveAngleHoldAxis ();
63036303 if (isAngleHoldLevel ()) {
6304- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_ANGLEHOLD_LEVEL );
6304+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_ANGLEHOLD_LEVEL ) );
63056305 } else if (navAngleHoldAxis == FD_ROLL ) {
6306- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_ANGLEHOLD_ROLL );
6306+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_ANGLEHOLD_ROLL ) );
63076307 } else if (navAngleHoldAxis == FD_PITCH ) {
6308- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_ANGLEHOLD_PITCH );
6308+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_ANGLEHOLD_PITCH ) );
63096309 }
63106310 }
63116311
@@ -6318,16 +6318,16 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
63186318 } else {
63196319 strcpy (messageBuf , "(HOLD)" );
63206320 }
6321- messages [ messageCount ++ ] = messageBuf ;
6321+ ADD_MSG ( messageBuf ) ;
63226322 } else if (FLIGHT_MODE (HEADFREE_MODE )) {
6323- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_HEADFREE );
6323+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_HEADFREE ) );
63246324 }
63256325 if (FLIGHT_MODE (NAV_ALTHOLD_MODE ) && !navigationRequiresAngleMode ()) {
63266326 /* If ALTHOLD is separately enabled for multirotor together with ANGL/HORIZON/ACRO modes
63276327 * then ANGL/HORIZON/ACRO are indicated by the OSD_FLYMODE field.
63286328 * In this case indicate ALTHOLD is active via a system message */
63296329
6330- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_ALTITUDE_HOLD );
6330+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_ALTITUDE_HOLD ) );
63316331 }
63326332 }
63336333 }
@@ -6342,44 +6342,44 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
63426342 messageBuf [ii ] = sl_toupper (messageBuf [ii ]);
63436343 }
63446344 invertedInfoMessage = messageBuf ;
6345- messages [ messageCount ++ ] = invertedInfoMessage ;
6345+ ADD_MSG ( invertedInfoMessage ) ;
63466346
63476347 invertedInfoMessage = OSD_MESSAGE_STR (OSD_MSG_INVALID_SETTING );
6348- messages [ messageCount ++ ] = invertedInfoMessage ;
6348+ ADD_MSG ( invertedInfoMessage ) ;
63496349 } else {
63506350 invertedInfoMessage = OSD_MESSAGE_STR (OSD_MSG_UNABLE_ARM );
6351- messages [ messageCount ++ ] = invertedInfoMessage ;
6351+ ADD_MSG ( invertedInfoMessage ) ;
63526352 // Show the reason for not arming
6353- messages [ messageCount ++ ] = osdArmingDisabledReasonMessage ();
6353+ ADD_MSG ( osdArmingDisabledReasonMessage () );
63546354 }
63556355 } else if (!ARMING_FLAG (ARMED )) {
63566356 if (isWaypointListValid ()) {
6357- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_WP_MISSION_LOADED );
6357+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_WP_MISSION_LOADED ) );
63586358 }
63596359 }
63606360
63616361 /* Messages that are shown regardless of Arming state */
63626362 /* ADDS MAXIMUM OF 2 MESSAGES TO TOTAL NORMALLY, 1 MESSAGE DURING FAILSAFE */
63636363 if (posControl .flags .wpMissionPlannerActive && !FLIGHT_MODE (FAILSAFE_MODE )) {
6364- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_MISSION_PLANNER );
6364+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_MISSION_PLANNER ) );
63656365 }
63666366
63676367 // The following has been commented out as it will be added in #9688
63686368 // uint16_t rearmMs = (emergInflightRearmEnabled()) ? emergencyInFlightRearmTimeMS() : 0;
63696369
63706370 if (savingSettings == true) {
6371- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_SAVING_SETTNGS );
6371+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_SAVING_SETTNGS ) );
63726372 /*} else if (rearmMs > 0) { // Show rearming time if settings not actively being saved. Ignore the settings saved message if rearm available.
63736373 char emReArmMsg[23];
63746374 tfp_sprintf(emReArmMsg, "** REARM PERIOD: ");
63756375 tfp_sprintf(emReArmMsg + strlen(emReArmMsg), "%02d", (uint8_t)MS2S(rearmMs));
63766376 strcat(emReArmMsg, " **\0");
6377- messages[messageCount++] = OSD_MESSAGE_STR(emReArmMsg);*/
6377+ ADD_MSG( OSD_MESSAGE_STR(emReArmMsg) );*/
63786378 } else if (notify_settings_saved > 0 ) {
63796379 if (millis () > notify_settings_saved ) {
63806380 notify_settings_saved = 0 ;
63816381 } else {
6382- messages [ messageCount ++ ] = OSD_MESSAGE_STR (OSD_MSG_SETTINGS_SAVED );
6382+ ADD_MSG ( OSD_MESSAGE_STR (OSD_MSG_SETTINGS_SAVED ) );
63836383 }
63846384 }
63856385
@@ -6402,6 +6402,7 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
64026402
64036403 osdFormatMessage (buff , buff_size , message , isCenteredText );
64046404 }
6405+ #undef ADD_MSG
64056406 return elemAttr ;
64066407}
64076408
@@ -6526,6 +6527,7 @@ static textAttributes_t osdGetMultiFunctionMessage(char *buff)
65266527 /* --- WARNINGS --- */
65276528 const char * messages [7 ];
65286529 uint8_t messageCount = 0 ;
6530+ #define ADD_MSG (msg ) if (messageCount < ARRAYLEN(messages)) messages[messageCount++] = (msg)
65296531 bool warningCondition = false;
65306532 warningsCount = 0 ;
65316533 uint8_t warningFlagID = 1 ;
@@ -6534,28 +6536,28 @@ static textAttributes_t osdGetMultiFunctionMessage(char *buff)
65346536 const batteryState_e batteryState = getBatteryState ();
65356537 warningCondition = batteryState == BATTERY_CRITICAL || batteryState == BATTERY_WARNING ;
65366538 if (osdCheckWarning (warningCondition , warningFlagID , & warningsCount )) {
6537- messages [ messageCount ++ ] = batteryState == BATTERY_CRITICAL ? "BATT EMPTY" : "BATT LOW !" ;
6539+ ADD_MSG ( batteryState == BATTERY_CRITICAL ? "BATT EMPTY" : "BATT LOW !" ) ;
65386540 }
65396541
65406542#if defined(USE_GPS )
65416543 // GPS Fix and Failure
65426544 if (feature (FEATURE_GPS )) {
65436545 if (osdCheckWarning (!STATE (GPS_FIX ), warningFlagID <<= 1 , & warningsCount )) {
65446546 bool gpsFailed = getHwGPSStatus () == HW_SENSOR_UNAVAILABLE ;
6545- messages [ messageCount ++ ] = gpsFailed ? "GPS FAILED" : "NO GPS FIX" ;
6547+ ADD_MSG ( gpsFailed ? "GPS FAILED" : "NO GPS FIX" ) ;
65466548 }
65476549 }
65486550
65496551 // RTH sanity (warning if RTH heads 200m further away from home than closest point)
65506552 warningCondition = NAV_Status .state == MW_NAV_STATE_RTH_ENROUTE && !posControl .flags .rthTrackbackActive &&
65516553 (posControl .homeDistance - posControl .rthSanityChecker .minimalDistanceToHome ) > 20000 ;
65526554 if (osdCheckWarning (warningCondition , warningFlagID <<= 1 , & warningsCount )) {
6553- messages [ messageCount ++ ] = "RTH SANITY" ;
6555+ ADD_MSG ( "RTH SANITY" ) ;
65546556 }
65556557
65566558 // Altitude sanity (warning if significant mismatch between estimated and GPS altitude)
65576559 if (osdCheckWarning (posControl .flags .gpsCfEstimatedAltitudeMismatch , warningFlagID <<= 1 , & warningsCount )) {
6558- messages [ messageCount ++ ] = "ALT SANITY" ;
6560+ ADD_MSG ( "ALT SANITY" ) ;
65596561 }
65606562#endif
65616563
@@ -6564,7 +6566,7 @@ static textAttributes_t osdGetMultiFunctionMessage(char *buff)
65646566 if (requestedSensors [SENSOR_INDEX_MAG ] != MAG_NONE ) {
65656567 hardwareSensorStatus_e magStatus = getHwCompassStatus ();
65666568 if (osdCheckWarning (magStatus == HW_SENSOR_UNAVAILABLE || magStatus == HW_SENSOR_UNHEALTHY , warningFlagID <<= 1 , & warningsCount )) {
6567- messages [ messageCount ++ ] = "MAG FAILED" ;
6569+ ADD_MSG ( "MAG FAILED" ) ;
65686570 }
65696571 }
65706572#endif
@@ -6573,7 +6575,7 @@ static textAttributes_t osdGetMultiFunctionMessage(char *buff)
65736575 // Pitot sensor validation failure (blocked/failed pitot tube)
65746576 if (sensors (SENSOR_PITOT ) && detectedSensors [SENSOR_INDEX_PITOT ] != PITOT_VIRTUAL ) {
65756577 if (osdCheckWarning (pitotHasFailed (), warningFlagID <<= 1 , & warningsCount )) {
6576- messages [ messageCount ++ ] = "PITOT FAIL" ;
6578+ ADD_MSG ( "PITOT FAIL" ) ;
65776579 }
65786580 }
65796581#endif
@@ -6582,12 +6584,12 @@ static textAttributes_t osdGetMultiFunctionMessage(char *buff)
65826584 // const float vibrationLevel = accGetVibrationLevel();
65836585 // warningCondition = vibrationLevel > 1.5f;
65846586 // if (osdCheckWarning(warningCondition, warningFlagID <<= 1, &warningsCount)) {
6585- // messages[messageCount++] = vibrationLevel > 2.5f ? "BAD VIBRTN" : "VIBRATION!";
6587+ // ADD_MSG( vibrationLevel > 2.5f ? "BAD VIBRTN" : "VIBRATION!") ;
65866588 // }
65876589
65886590#ifdef USE_DEV_TOOLS
65896591 if (osdCheckWarning (systemConfig ()-> groundTestMode , warningFlagID <<= 1 , & warningsCount )) {
6590- messages [ messageCount ++ ] = "GRD TEST !" ;
6592+ ADD_MSG ( "GRD TEST !" ) ;
65916593 }
65926594#endif
65936595
@@ -6600,6 +6602,7 @@ static textAttributes_t osdGetMultiFunctionMessage(char *buff)
66006602 tfp_sprintf (buff + 1 , "%u " , warningsCount );
66016603 }
66026604
6605+ #undef ADD_MSG
66036606 return elemAttr ;
66046607}
66056608
0 commit comments