mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-21 15:25:29 +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) {
|
} else if (sl_strcasecmp(cmdline, "reset") == 0) {
|
||||||
resetWaypointList();
|
resetWaypointList();
|
||||||
} else if (sl_strcasecmp(cmdline, "load") == 0) {
|
} else if (sl_strcasecmp(cmdline, "load") == 0) {
|
||||||
loadNonVolatileWaypointList();
|
loadNonVolatileWaypointList(true);
|
||||||
} else if (sl_strcasecmp(cmdline, "save") == 0) {
|
} else if (sl_strcasecmp(cmdline, "save") == 0) {
|
||||||
posControl.waypointListValid = false;
|
posControl.waypointListValid = false;
|
||||||
for (int i = 0; i < NAV_MAX_WAYPOINTS; i++) {
|
for (int i = 0; i < NAV_MAX_WAYPOINTS; i++) {
|
||||||
|
@ -2930,28 +2930,28 @@ static void printImu2Status(void)
|
||||||
cliPrintLinef("Acc: %d", secondaryImuState.calibrationStatus.acc);
|
cliPrintLinef("Acc: %d", secondaryImuState.calibrationStatus.acc);
|
||||||
cliPrintLinef("Mag: %d", secondaryImuState.calibrationStatus.mag);
|
cliPrintLinef("Mag: %d", secondaryImuState.calibrationStatus.mag);
|
||||||
cliPrintLine("Calibration gains:");
|
cliPrintLine("Calibration gains:");
|
||||||
|
|
||||||
cliPrintLinef(
|
cliPrintLinef(
|
||||||
"Gyro: %d %d %d",
|
"Gyro: %d %d %d",
|
||||||
secondaryImuConfig()->calibrationOffsetGyro[X],
|
secondaryImuConfig()->calibrationOffsetGyro[X],
|
||||||
secondaryImuConfig()->calibrationOffsetGyro[Y],
|
secondaryImuConfig()->calibrationOffsetGyro[Y],
|
||||||
secondaryImuConfig()->calibrationOffsetGyro[Z]
|
secondaryImuConfig()->calibrationOffsetGyro[Z]
|
||||||
);
|
);
|
||||||
cliPrintLinef(
|
cliPrintLinef(
|
||||||
"Acc: %d %d %d",
|
"Acc: %d %d %d",
|
||||||
secondaryImuConfig()->calibrationOffsetAcc[X],
|
secondaryImuConfig()->calibrationOffsetAcc[X],
|
||||||
secondaryImuConfig()->calibrationOffsetAcc[Y],
|
secondaryImuConfig()->calibrationOffsetAcc[Y],
|
||||||
secondaryImuConfig()->calibrationOffsetAcc[Z]
|
secondaryImuConfig()->calibrationOffsetAcc[Z]
|
||||||
);
|
);
|
||||||
cliPrintLinef(
|
cliPrintLinef(
|
||||||
"Mag: %d %d %d",
|
"Mag: %d %d %d",
|
||||||
secondaryImuConfig()->calibrationOffsetMag[X],
|
secondaryImuConfig()->calibrationOffsetMag[X],
|
||||||
secondaryImuConfig()->calibrationOffsetMag[Y],
|
secondaryImuConfig()->calibrationOffsetMag[Y],
|
||||||
secondaryImuConfig()->calibrationOffsetMag[Z]
|
secondaryImuConfig()->calibrationOffsetMag[Z]
|
||||||
);
|
);
|
||||||
cliPrintLinef(
|
cliPrintLinef(
|
||||||
"Radius: %d %d",
|
"Radius: %d %d",
|
||||||
secondaryImuConfig()->calibrationRadiusAcc,
|
secondaryImuConfig()->calibrationRadiusAcc,
|
||||||
secondaryImuConfig()->calibrationRadiusMag
|
secondaryImuConfig()->calibrationRadiusMag
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2847,7 +2847,7 @@ static mspResult_e mspFcProcessInCommand(uint16_t cmdMSP, sbuf_t *src)
|
||||||
#ifdef NAV_NON_VOLATILE_WAYPOINT_STORAGE
|
#ifdef NAV_NON_VOLATILE_WAYPOINT_STORAGE
|
||||||
case MSP_WP_MISSION_LOAD:
|
case MSP_WP_MISSION_LOAD:
|
||||||
sbufReadU8Safe(NULL, src); // Mission ID (reserved)
|
sbufReadU8Safe(NULL, src); // Mission ID (reserved)
|
||||||
if ((dataSize != 1) || (!loadNonVolatileWaypointList()))
|
if ((dataSize != 1) || (!loadNonVolatileWaypointList(false)))
|
||||||
return MSP_RESULT_ERROR;
|
return MSP_RESULT_ERROR;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
|
@ -260,7 +260,7 @@ void processRcStickPositions(throttleStatus_e throttleStatus)
|
||||||
|
|
||||||
// Load waypoint list
|
// Load waypoint list
|
||||||
if (rcSticks == THR_LO + YAW_CE + PIT_HI + ROL_HI) {
|
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);
|
beeper(success ? BEEPER_ACTION_SUCCESS : BEEPER_ACTION_FAIL);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -2876,13 +2876,13 @@ int getWaypointCount(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef NAV_NON_VOLATILE_WAYPOINT_STORAGE
|
#ifdef NAV_NON_VOLATILE_WAYPOINT_STORAGE
|
||||||
bool loadNonVolatileWaypointList(void)
|
bool loadNonVolatileWaypointList(bool clearIfLoaded)
|
||||||
{
|
{
|
||||||
if (ARMING_FLAG(ARMED))
|
if (ARMING_FLAG(ARMED))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// if waypoints are already loaded, just unload them.
|
// if forced and waypoints are already loaded, just unload them.
|
||||||
if (posControl.waypointCount > 0) {
|
if (clearIfLoaded && posControl.waypointCount > 0) {
|
||||||
resetWaypointList();
|
resetWaypointList();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -467,7 +467,7 @@ bool isWaypointListValid(void);
|
||||||
void getWaypoint(uint8_t wpNumber, navWaypoint_t * wpData);
|
void getWaypoint(uint8_t wpNumber, navWaypoint_t * wpData);
|
||||||
void setWaypoint(uint8_t wpNumber, const navWaypoint_t * wpData);
|
void setWaypoint(uint8_t wpNumber, const navWaypoint_t * wpData);
|
||||||
void resetWaypointList(void);
|
void resetWaypointList(void);
|
||||||
bool loadNonVolatileWaypointList(void);
|
bool loadNonVolatileWaypointList(bool);
|
||||||
bool saveNonVolatileWaypointList(void);
|
bool saveNonVolatileWaypointList(void);
|
||||||
|
|
||||||
float getFinalRTHAltitude(void);
|
float getFinalRTHAltitude(void);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue