mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-20 06:45:14 +03:00
First build
This commit is contained in:
parent
ee06203151
commit
88a4ceb1aa
4 changed files with 21 additions and 9 deletions
|
@ -1199,7 +1199,7 @@ static void osdDisplayFlightPIDValues(uint8_t elemPosX, uint8_t elemPosY, const
|
|||
if ((isAdjustmentFunctionSelected(adjFuncD)) || (((adjFuncD == ADJUSTMENT_ROLL_D) || (adjFuncD == ADJUSTMENT_PITCH_D)) && (isAdjustmentFunctionSelected(ADJUSTMENT_PITCH_ROLL_D))))
|
||||
TEXT_ATTRIBUTES_ADD_BLINK(elemAttr);
|
||||
displayWriteWithAttr(osdDisplayPort, elemPosX + 12, elemPosY, buff, elemAttr);
|
||||
|
||||
|
||||
elemAttr = TEXT_ATTRIBUTES_NONE;
|
||||
tfp_sprintf(buff, "%3d", pid->FF);
|
||||
if ((isAdjustmentFunctionSelected(adjFuncFF)) || (((adjFuncFF == ADJUSTMENT_ROLL_FF) || (adjFuncFF == ADJUSTMENT_PITCH_FF)) && (isAdjustmentFunctionSelected(ADJUSTMENT_PITCH_ROLL_FF))))
|
||||
|
@ -2238,17 +2238,17 @@ static bool osdDrawSingleElement(uint8_t item)
|
|||
}
|
||||
case OSD_DEBUG:
|
||||
{
|
||||
/*
|
||||
* Longest representable string is -2147483648 does not fit in the screen.
|
||||
/*
|
||||
* Longest representable string is -2147483648 does not fit in the screen.
|
||||
* Only 7 digits for negative and 8 digits for positive values allowed
|
||||
*/
|
||||
for (uint8_t bufferIndex = 0; bufferIndex < DEBUG32_VALUE_COUNT; ++elemPosY, bufferIndex += 2) {
|
||||
tfp_sprintf(
|
||||
buff,
|
||||
"[%u]=%8ld [%u]=%8ld",
|
||||
bufferIndex,
|
||||
constrain(debug[bufferIndex], -9999999, 99999999),
|
||||
bufferIndex+1,
|
||||
buff,
|
||||
"[%u]=%8ld [%u]=%8ld",
|
||||
bufferIndex,
|
||||
constrain(debug[bufferIndex], -9999999, 99999999),
|
||||
bufferIndex+1,
|
||||
constrain(debug[bufferIndex+1], -9999999, 99999999)
|
||||
);
|
||||
displayWrite(osdDisplayPort, elemPosX, elemPosY, buff);
|
||||
|
@ -3437,6 +3437,11 @@ textAttributes_t osdGetSystemMessage(char *buff, size_t buff_size, bool isCenter
|
|||
}
|
||||
} else {
|
||||
if (FLIGHT_MODE(NAV_RTH_MODE) || FLIGHT_MODE(NAV_WP_MODE) || navigationIsExecutingAnEmergencyLanding()) {
|
||||
if (isWaypointMissionRTHActive()) {
|
||||
// if RTH activated whilst WP mode selected, remind pilot to cancel WP mode to exit RTH
|
||||
messages[messageCount++] = OSD_MESSAGE_STR(OSD_MSG_WP_RTH_CANCEL);
|
||||
}
|
||||
|
||||
if (NAV_Status.state == MW_NAV_STATE_WP_ENROUTE) {
|
||||
// Countdown display for remaining Waypoints
|
||||
tfp_sprintf(messageBuf, "TO WP %u/%u", posControl.activeWaypointIndex + 1, posControl.waypointCount);
|
||||
|
|
|
@ -98,6 +98,7 @@
|
|||
#define OSD_MSG_AUTOTUNE "(AUTOTUNE)"
|
||||
#define OSD_MSG_HEADFREE "(HEADFREE)"
|
||||
#define OSD_MSG_UNABLE_ARM "UNABLE TO ARM"
|
||||
#define OSD_MSG_WP_RTH_CANCEL "CANCEL WP MODE TO EXIT RTH"
|
||||
|
||||
typedef enum {
|
||||
OSD_RSSI_VALUE,
|
||||
|
|
|
@ -3149,7 +3149,7 @@ static navigationFSMEvent_t selectNavEventFromBoxModeInput(void)
|
|||
}
|
||||
|
||||
// Pilot-triggered RTH, also fall-back for WP if there is no mission loaded
|
||||
if (IS_RC_MODE_ACTIVE(BOXNAVRTH) || (IS_RC_MODE_ACTIVE(BOXNAVWP) && !canActivateWaypoint)) {
|
||||
if (IS_RC_MODE_ACTIVE(BOXNAVRTH) || (IS_RC_MODE_ACTIVE(BOXNAVWP) && !canActivateWaypoint && !IS_RC_MODE_ACTIVE(BOXMANUAL))) {
|
||||
// Check for isExecutingRTH to prevent switching our from RTH in case of a brief GPS loss
|
||||
// If don't keep this, loss of any of the canActivatePosHold && canActivateNavigation && canActivateAltHold
|
||||
// will kick us out of RTH state machine via NAV_FSM_EVENT_SWITCH_TO_IDLE and will prevent any of the fall-back
|
||||
|
@ -3570,6 +3570,11 @@ rthState_e getStateOfForcedRTH(void)
|
|||
}
|
||||
}
|
||||
|
||||
bool isWaypointMissionRTHActive(void)
|
||||
{
|
||||
return FLIGHT_MODE(NAV_RTH_MODE) && IS_RC_MODE_ACTIVE(BOXNAVWP) && !(IS_RC_MODE_ACTIVE(BOXNAVRTH) || posControl.flags.forcedRTHActivated);
|
||||
}
|
||||
|
||||
bool navigationIsExecutingAnEmergencyLanding(void)
|
||||
{
|
||||
return navGetCurrentStateFlags() & NAV_CTL_EMERG;
|
||||
|
|
|
@ -500,6 +500,7 @@ bool navigationIsExecutingAnEmergencyLanding(void);
|
|||
* or if it's NAV_RTH_ALLOW_LANDING_FAILSAFE and failsafe mode is active.
|
||||
*/
|
||||
bool navigationRTHAllowsLanding(void);
|
||||
bool isWaypointMissionRTHActive(void);
|
||||
|
||||
bool isNavLaunchEnabled(void);
|
||||
bool isFixedWingLaunchDetected(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue