From 012c7fbe9ca0318a3dae47e632913c91e23278c0 Mon Sep 17 00:00:00 2001 From: breadoven <56191411+breadoven@users.noreply.github.com> Date: Mon, 7 Jun 2021 09:36:10 +0100 Subject: [PATCH] Update osd.c --- src/main/io/osd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/main/io/osd.c b/src/main/io/osd.c index 20dea5c151..08f1575b77 100644 --- a/src/main/io/osd.c +++ b/src/main/io/osd.c @@ -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)