mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-19 06:15:14 +03:00
Change Index List
Change from using WP .P3 to dedicated geospatial WP list list array
This commit is contained in:
parent
94e199ecd9
commit
36974174aa
3 changed files with 4 additions and 11 deletions
|
@ -2837,17 +2837,13 @@ void setWaypoint(uint8_t wpNumber, const navWaypoint_t * wpData)
|
|||
|
||||
if (wpNumber == (posControl.waypointCount + 1) || wpNumber == 1) {
|
||||
posControl.waypointList[wpNumber - 1] = *wpData;
|
||||
|
||||
if(wpData->action == NAV_WP_ACTION_SET_POI || wpData->action == NAV_WP_ACTION_SET_HEAD || wpData->action == NAV_WP_ACTION_JUMP) {
|
||||
nonGeoWaypointCount += 1;
|
||||
if(wpData->action == NAV_WP_ACTION_JUMP) {
|
||||
posControl.waypointList[wpNumber - 1].p1 -= 1; // make index (vice WP #)
|
||||
} else {
|
||||
posControl.waypointList[wpNumber - 1].p3 = wpNumber - nonGeoWaypointCount;
|
||||
}
|
||||
} else {
|
||||
posControl.waypointList[wpNumber - 1].p3 = wpNumber - nonGeoWaypointCount;
|
||||
}
|
||||
posControl.geoWaypointList[wpNumber - 1] = wpNumber - nonGeoWaypointCount;
|
||||
|
||||
posControl.waypointCount = wpNumber;
|
||||
posControl.waypointListValid = (wpData->flag == NAV_WP_FLAG_LAST);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue