mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-17 13:25:27 +03:00
Update osd.c
This commit is contained in:
parent
b4b11c40bd
commit
012c7fbe9c
1 changed files with 4 additions and 5 deletions
|
@ -1386,21 +1386,20 @@ static void osdDisplayAdjustableDecimalValue(uint8_t elemPosX, uint8_t elemPosY,
|
||||||
int8_t getGeoWaypointNumber(int8_t waypointIndex)
|
int8_t getGeoWaypointNumber(int8_t waypointIndex)
|
||||||
{
|
{
|
||||||
static int8_t lastWaypointIndex = 1;
|
static int8_t lastWaypointIndex = 1;
|
||||||
static int8_t lastGeoWaypointIndex;
|
static int8_t geoWaypointIndex;
|
||||||
|
|
||||||
if (waypointIndex != lastWaypointIndex) {
|
if (waypointIndex != lastWaypointIndex) {
|
||||||
lastWaypointIndex = waypointIndex;
|
lastWaypointIndex = geoWaypointIndex = waypointIndex;
|
||||||
lastGeoWaypointIndex = waypointIndex;
|
|
||||||
for (uint8_t i = 0; i <= waypointIndex; i++) {
|
for (uint8_t i = 0; i <= waypointIndex; i++) {
|
||||||
if (posControl.waypointList[i].action == NAV_WP_ACTION_SET_POI ||
|
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_SET_HEAD ||
|
||||||
posControl.waypointList[i].action == NAV_WP_ACTION_JUMP) {
|
posControl.waypointList[i].action == NAV_WP_ACTION_JUMP) {
|
||||||
lastGeoWaypointIndex -= 1;
|
geoWaypointIndex -= 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return lastGeoWaypointIndex + 1;
|
return geoWaypointIndex + 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool osdDrawSingleElement(uint8_t item)
|
static bool osdDrawSingleElement(uint8_t item)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue