1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-18 05:45:31 +03:00

Fix arming on Low Throttle when 3D Mode On switch disabled

This commit is contained in:
borisbstyle 2016-04-04 23:28:29 +02:00
parent c694c67890
commit 5290e4be56
3 changed files with 80 additions and 4 deletions

View file

@ -113,10 +113,13 @@ bool areSticksInApModePosition(uint16_t ap_mode)
throttleStatus_e calculateThrottleStatus(rxConfig_t *rxConfig, uint16_t deadband3d_throttle) throttleStatus_e calculateThrottleStatus(rxConfig_t *rxConfig, uint16_t deadband3d_throttle)
{ {
if (feature(FEATURE_3D) && (rcData[THROTTLE] > (rxConfig->midrc - deadband3d_throttle) && rcData[THROTTLE] < (rxConfig->midrc + deadband3d_throttle))) if (feature(FEATURE_3D) && !IS_RC_MODE_ACTIVE(BOX3DDISABLESWITCH)) {
return THROTTLE_LOW; if ((rcData[THROTTLE] > (rxConfig->midrc - deadband3d_throttle) && rcData[THROTTLE] < (rxConfig->midrc + deadband3d_throttle)))
else if (!feature(FEATURE_3D) && (rcData[THROTTLE] < rxConfig->mincheck)) return THROTTLE_LOW;
return THROTTLE_LOW; } else {
if (rcData[THROTTLE] < rxConfig->mincheck)
return THROTTLE_LOW;
}
return THROTTLE_HIGH; return THROTTLE_HIGH;
} }

View file

@ -0,0 +1,37 @@
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*
* Ported from https://github.com/4712/BLHeliSuite/blob/master/Interfaces/Arduino1Wire/Source/Arduino1Wire_C/Arduino1Wire.c
* by Nathan Tsoi <nathan@vertile.com>
*/
#pragma once
#ifdef USE_SERIAL_1WIRE
extern uint8_t escCount;
typedef struct {
GPIO_TypeDef* gpio;
uint16_t pinpos;
uint16_t pin;
} escHardware_t;
void usb1WireInitialize();
void usb1WirePassthrough(uint8_t escIndex);
void usb1WireDeInitialize(void);
#endif

View file

@ -0,0 +1,36 @@
/*
* This file is part of Cleanflight.
*
* Cleanflight is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* Cleanflight is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*
* Ported from https://github.com/4712/BLHeliSuite/blob/master/Interfaces/Arduino1Wire/Source/Arduino1Wire_C/Arduino1Wire.c
* by Nathan Tsoi <nathan@vertile.com>
*/
#pragma once
#ifdef USE_SERIAL_1WIRE
extern uint8_t escCount;
typedef struct {
GPIO_TypeDef* gpio;
uint16_t pinpos;
uint16_t pin;
} escHardware_t;
void usb1WireInitialize();
void usb1WirePassthrough(uint8_t escIndex);
#endif