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

improve function definition

This commit is contained in:
breadoven 2021-12-04 12:06:46 +00:00
parent e7a894b294
commit ff3cfdf704
4 changed files with 5 additions and 5 deletions

View file

@ -3062,8 +3062,8 @@ bool isLastMissionWaypoint(void)
(posControl.waypointList[posControl.activeWaypointIndex].flag == NAV_WP_FLAG_LAST));
}
/* Checks if approaching hold position requiring fixed wing circling loiter */
bool isApproachingHoldPosition(void)
/* Checks if Nav hold position is active */
bool isNavHoldPositionActive(void)
{
if (FLIGHT_MODE(NAV_WP_MODE)) { // WP mode last WP hold and Timed hold positions
return isLastMissionWaypoint() || NAV_Status.state == MW_NAV_STATE_HOLD_TIMED;

View file

@ -277,7 +277,7 @@ static void calculateVirtualPositionTarget_FW(float trackingPeriod)
// If angular visibility of a waypoint is less than 30deg, don't calculate circular loiter, go straight to the target
#define TAN_15DEG 0.26795f
bool needToCalculateCircularLoiter = isApproachingHoldPosition() &&
bool needToCalculateCircularLoiter = isNavHoldPositionActive() &&
(distanceToActualTarget <= (navLoiterRadius / TAN_15DEG)) &&
(distanceToActualTarget > 50.0f);

View file

@ -446,7 +446,7 @@ static void updatePositionVelocityController_MC(const float maxSpeed)
*/
if (
(navGetCurrentStateFlags() & NAV_AUTO_WP &&
!isApproachingHoldPosition() &&
!isNavHoldPositionActive() &&
newVelTotal < maxSpeed &&
!navConfig()->mc.slowDownForTurning
) || newVelTotal > maxSpeed

View file

@ -418,7 +418,7 @@ void updateClimbRateToAltitudeController(float desiredClimbRate, climbRateToAlti
bool isWaypointReached(const navWaypointPosition_t * waypoint, const bool isWaypointHome);
bool isWaypointMissed(const navWaypointPosition_t * waypoint);
bool isApproachingHoldPosition(void);
bool isNavHoldPositionActive(void);
bool isLastMissionWaypoint(void);
float getActiveWaypointSpeed(void);