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

Update osd.c

This commit is contained in:
breadoven 2021-06-07 09:36:10 +01:00
parent b4b11c40bd
commit 012c7fbe9c

View file

@ -1386,21 +1386,20 @@ static void osdDisplayAdjustableDecimalValue(uint8_t elemPosX, uint8_t elemPosY,
int8_t getGeoWaypointNumber(int8_t waypointIndex)
{
static int8_t lastWaypointIndex = 1;
static int8_t lastGeoWaypointIndex;
static int8_t geoWaypointIndex;
if (waypointIndex != lastWaypointIndex) {
lastWaypointIndex = waypointIndex;
lastGeoWaypointIndex = waypointIndex;
lastWaypointIndex = geoWaypointIndex = waypointIndex;
for (uint8_t i = 0; i <= waypointIndex; i++) {
if (posControl.waypointList[i].action == NAV_WP_ACTION_SET_POI ||
posControl.waypointList[i].action == NAV_WP_ACTION_SET_HEAD ||
posControl.waypointList[i].action == NAV_WP_ACTION_JUMP) {
lastGeoWaypointIndex -= 1;
geoWaypointIndex -= 1;
}
}
}
return lastGeoWaypointIndex + 1;
return geoWaypointIndex + 1;
}
static bool osdDrawSingleElement(uint8_t item)