mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 00:05:28 +03:00
fix WP MSP regression from #6612
This commit is contained in:
parent
47f2468f0e
commit
9c6bd6a95f
5 changed files with 19 additions and 19 deletions
|
@ -1387,7 +1387,7 @@ static void cliWaypoints(char *cmdline)
|
|||
} else if (sl_strcasecmp(cmdline, "reset") == 0) {
|
||||
resetWaypointList();
|
||||
} else if (sl_strcasecmp(cmdline, "load") == 0) {
|
||||
loadNonVolatileWaypointList();
|
||||
loadNonVolatileWaypointList(true);
|
||||
} else if (sl_strcasecmp(cmdline, "save") == 0) {
|
||||
posControl.waypointListValid = false;
|
||||
for (int i = 0; i < NAV_MAX_WAYPOINTS; i++) {
|
||||
|
|
|
@ -2847,7 +2847,7 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
|||
#ifdef NAV_NON_VOLATILE_WAYPOINT_STORAGE
|
||||
case MSP_WP_MISSION_LOAD:
|
||||
sbufReadU8Safe(NULL, src); // Mission ID (reserved)
|
||||
if ((dataSize != 1) || (!loadNonVolatileWaypointList()))
|
||||
if ((dataSize != 1) || (!loadNonVolatileWaypointList(false)))
|
||||
return MSP_RESULT_ERROR;
|
||||
break;
|
||||
|
||||
|
|
|
@ -260,7 +260,7 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
|
|||
|
||||
// Load waypoint list
|
||||
if (rcSticks == THR_LO + YAW_CE + PIT_HI + ROL_HI) {
|
||||
const bool success = loadNonVolatileWaypointList();
|
||||
const bool success = loadNonVolatileWaypointList(false);
|
||||
beeper(success ? BEEPER_ACTION_SUCCESS : BEEPER_ACTION_FAIL);
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2876,13 +2876,13 @@ int getWaypointCount(void)
|
|||
}
|
||||
|
||||
#ifdef NAV_NON_VOLATILE_WAYPOINT_STORAGE
|
||||
bool loadNonVolatileWaypointList(void)
|
||||
bool loadNonVolatileWaypointList(bool clearIfLoaded)
|
||||
{
|
||||
if (ARMING_FLAG(ARMED))
|
||||
return false;
|
||||
|
||||
// if waypoints are already loaded, just unload them.
|
||||
if (posControl.waypointCount > 0) {
|
||||
// if forced and waypoints are already loaded, just unload them.
|
||||
if (clearIfLoaded && posControl.waypointCount > 0) {
|
||||
resetWaypointList();
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -467,7 +467,7 @@ bool isWaypointListValid(void);
|
|||
void getWaypoint(uint8_t wpNumber, navWaypoint_t * wpData);
|
||||
void setWaypoint(uint8_t wpNumber, const navWaypoint_t * wpData);
|
||||
void resetWaypointList(void);
|
||||
bool loadNonVolatileWaypointList(void);
|
||||
bool loadNonVolatileWaypointList(bool);
|
||||
bool saveNonVolatileWaypointList(void);
|
||||
|
||||
float getFinalRTHAltitude(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue