mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 05:45:31 +03:00
AIR MODE Safety Enhancements
This commit is contained in:
parent
72e9a4dc17
commit
b84e9f4676
5 changed files with 46 additions and 18 deletions
|
@ -65,6 +65,7 @@ static pidProfile_t *pidProfile;
|
|||
|
||||
// true if arming is done via the sticks (as opposed to a switch)
|
||||
static bool isUsingSticksToArm = true;
|
||||
static bool rollPitchCentered = true; // Roll and pitch are centered, AIR Mode condition
|
||||
|
||||
int16_t rcCommand[4]; // interval [1000;2000] for THROTTLE and [-500;+500] for ROLL/PITCH/YAW
|
||||
|
||||
|
@ -106,6 +107,10 @@ bool isUsingSticksForArming(void)
|
|||
return isUsingSticksToArm;
|
||||
}
|
||||
|
||||
bool isRollPitchCentered(void)
|
||||
{
|
||||
return rollPitchCentered;
|
||||
}
|
||||
|
||||
bool areSticksInApModePosition(uint16_t ap_mode)
|
||||
{
|
||||
|
@ -146,6 +151,12 @@ void processRcStickPositions(rxConfig_t *rxConfig, throttleStatus_e throttleStat
|
|||
rcDelayCommand = 0;
|
||||
rcSticks = stTmp;
|
||||
|
||||
if (rcSticks == PIT_CE + ROL_CE) {
|
||||
rollPitchCentered = true;
|
||||
} else {
|
||||
rollPitchCentered = false;
|
||||
}
|
||||
|
||||
// perform actions
|
||||
if (!isUsingSticksToArm) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue