1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-01-18 03:52:11 +01:00

fixed safety check for throttle low, needed for arming on switch, too, but not for disarming

This commit is contained in:
Corvus Corax 2013-07-18 14:10:33 +02:00
parent 7b5bf53200
commit 9ba1fbdccc

View File

@ -1038,8 +1038,19 @@ static void processArm(ManualControlCommandData *cmd, ManualControlSettingsData
{
bool lowThrottle = cmd->Throttle <= 0;
if (settings->Arming == MANUALCONTROLSETTINGS_ARMING_ACCESSORY2) {
lowThrottle = true;
/**
* do NOT check throttle if disarming via switch, must be instant
*/
switch (settings->Arming) {
case MANUALCONTROLSETTINGS_ARMING_ACCESSORY0:
case MANUALCONTROLSETTINGS_ARMING_ACCESSORY1:
case MANUALCONTROLSETTINGS_ARMING_ACCESSORY2:
if (!armSwitch) {
lowThrottle = true;
}
break;
default:
break;
}
if (forcedDisArm()) {