1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-15 04:15:44 +03:00

Fix 3D arming checks for BOX3DDISABLE

When FEATURE_3D is on and BOX3DDISABLE is on then the normal throttle
arming check is performed.

When FEATURE_3D is on and BOX3DDISABLE is off then the reduced 3D
throttle arming check is performed.
This commit is contained in:
Dan Nixon 2017-11-08 18:52:00 +00:00
parent eadcf42650
commit 0315005445
3 changed files with 115 additions and 8 deletions

View file

@ -110,15 +110,14 @@ throttleStatus_e calculateThrottleStatus(void)
{
if (feature(FEATURE_3D)) {
if (IS_RC_MODE_ACTIVE(BOX3DDISABLE) || isModeActivationConditionPresent(BOX3DONASWITCH)) {
if (rcData[THROTTLE] < rxConfig()->mincheck)
if (rcData[THROTTLE] < rxConfig()->mincheck) {
return THROTTLE_LOW;
}
} else if ((rcData[THROTTLE] > (rxConfig()->midrc - flight3DConfig()->deadband3d_throttle) && rcData[THROTTLE] < (rxConfig()->midrc + flight3DConfig()->deadband3d_throttle))) {
return THROTTLE_LOW;
}
} else {
if (rcData[THROTTLE] < rxConfig()->mincheck) {
return THROTTLE_LOW;
}
} else if (rcData[THROTTLE] < rxConfig()->mincheck) {
return THROTTLE_LOW;
}
return THROTTLE_HIGH;