mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Initial cut on storing waypoints in configuration. Not supported on F1 targets
This commit is contained in:
parent
bfd2050731
commit
b0dd35417c
8 changed files with 74 additions and 13 deletions
|
@ -212,12 +212,27 @@ void processRcStickPositions(throttleStatus_e throttleStatus, bool disarm_kill_s
|
|||
// actions during not armed
|
||||
i = 0;
|
||||
|
||||
// GYRO calibration
|
||||
if (rcSticks == THR_LO + YAW_LO + PIT_LO + ROL_CE) {
|
||||
// GYRO calibration
|
||||
gyroSetCalibrationCycles(CALIBRATING_GYRO_CYCLES);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
#if defined(NAV_NON_VOLATILE_WAYPOINT_STORAGE)
|
||||
// Save waypoint list
|
||||
if (rcSticks == THR_LO + YAW_CE + PIT_HI + ROL_LO) {
|
||||
const bool success = saveNonVolatileWaypointList();
|
||||
beeper(success ? BEEPER_ACTION_SUCCESS : BEEPER_ACTION_FAIL);
|
||||
}
|
||||
|
||||
// Load waypoint list
|
||||
if (rcSticks == THR_LO + YAW_CE + PIT_HI + ROL_HI) {
|
||||
const bool success = loadNonVolatileWaypointList();
|
||||
beeper(success ? BEEPER_ACTION_SUCCESS : BEEPER_ACTION_FAIL);
|
||||
}
|
||||
#endif
|
||||
|
||||
// Multiple configuration profiles
|
||||
if (rcSticks == THR_LO + YAW_LO + PIT_CE + ROL_LO) // ROLL left -> Profile 1
|
||||
i = 1;
|
||||
|
@ -230,17 +245,17 @@ void processRcStickPositions(throttleStatus_e throttleStatus, bool disarm_kill_s
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
// Save config
|
||||
if (rcSticks == THR_LO + YAW_LO + PIT_LO + ROL_HI) {
|
||||
saveConfigAndNotify();
|
||||
}
|
||||
|
||||
|
||||
// Arming by sticks
|
||||
if (isUsingSticksToArm) {
|
||||
if (STATE(FIXED_WING) && feature(FEATURE_MOTOR_STOP) && fixed_wing_auto_arm) {
|
||||
// Auto arm on throttle when using fixedwing and motorstop
|
||||
if (throttleStatus != THROTTLE_LOW) {
|
||||
// Arm via YAW
|
||||
mwArm();
|
||||
return;
|
||||
}
|
||||
|
@ -255,15 +270,15 @@ void processRcStickPositions(throttleStatus_e throttleStatus, bool disarm_kill_s
|
|||
}
|
||||
|
||||
|
||||
// Calibrating Acc
|
||||
if (rcSticks == THR_HI + YAW_LO + PIT_LO + ROL_CE) {
|
||||
// Calibrating Acc
|
||||
accSetCalibrationCycles(CALIBRATING_ACC_CYCLES);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// Calibrating Mag
|
||||
if (rcSticks == THR_HI + YAW_HI + PIT_LO + ROL_CE) {
|
||||
// Calibrating Mag
|
||||
ENABLE_STATE(CALIBRATE_MAG);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue