1
0
Fork 0
mirror of https://github.com/iNavFlight/inav.git synced 2025-07-23 16:25:26 +03:00

warning safehome off

This commit is contained in:
Tony Yeung 2021-02-25 14:44:33 +00:00
parent f5b62f0283
commit 34422ffe87
2 changed files with 12 additions and 10 deletions

View file

@ -3095,13 +3095,17 @@ static void osdShowArmed(void)
} }
y += 4; y += 4;
#if defined (USE_SAFE_HOME) #if defined (USE_SAFE_HOME)
if (safehome_distance) { if (safehome_distance) { // safehome found during arming
textAttributes_t elemAttr = _TEXT_ATTRIBUTES_BLINK_BIT; if (navConfig()->general.flags.safehome_usage_mode == SAFEHOME_USAGE_OFF) {
char buf2[12]; // format the distance first strcpy(buf, "SAFEHOME FOUND; MODE OFF");
osdFormatDistanceStr(buf2, safehome_distance); } else {
tfp_sprintf(buf, "%c - %s -> SAFEHOME %u", SYM_HOME, buf2, safehome_index); char buf2[12]; // format the distance first
// write this message above the ARMED message to make it obvious osdFormatDistanceStr(buf2, safehome_distance);
displayWriteWithAttr(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y - 8, buf, elemAttr); tfp_sprintf(buf, "%c - %s -> SAFEHOME %u", SYM_HOME, buf2, safehome_index);
}
textAttributes_t elemAttr = _TEXT_ATTRIBUTES_BLINK_BIT;
// write this message above the ARMED message to make it obvious
displayWriteWithAttr(osdDisplayPort, (osdDisplayPort->cols - strlen(buf)) / 2, y - 8, buf, elemAttr);
} }
#endif #endif
} else { } else {

View file

@ -2416,9 +2416,7 @@ void updateHomePosition(void)
} }
if (setHome) { if (setHome) {
#if defined(USE_SAFE_HOME) #if defined(USE_SAFE_HOME)
if (navConfig()->general.flags.safehome_usage_mode != SAFEHOME_USAGE_OFF) { findNearestSafeHome();
findNearestSafeHome();
}
#endif #endif
setHomePosition(&posControl.actualState.abs.pos, posControl.actualState.yaw, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_Z | NAV_POS_UPDATE_HEADING, navigationActualStateHomeValidity()); setHomePosition(&posControl.actualState.abs.pos, posControl.actualState.yaw, NAV_POS_UPDATE_XY | NAV_POS_UPDATE_Z | NAV_POS_UPDATE_HEADING, navigationActualStateHomeValidity());
// save the current location in case it is replaced by a safehome or HOME_RESET // save the current location in case it is replaced by a safehome or HOME_RESET