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:
parent
c694c67890
commit
5290e4be56
3 changed files with 80 additions and 4 deletions
|
@ -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)) {
|
||||||
|
if ((rcData[THROTTLE] > (rxConfig->midrc - deadband3d_throttle) && rcData[THROTTLE] < (rxConfig->midrc + deadband3d_throttle)))
|
||||||
return THROTTLE_LOW;
|
return THROTTLE_LOW;
|
||||||
else if (!feature(FEATURE_3D) && (rcData[THROTTLE] < rxConfig->mincheck))
|
} else {
|
||||||
|
if (rcData[THROTTLE] < rxConfig->mincheck)
|
||||||
return THROTTLE_LOW;
|
return THROTTLE_LOW;
|
||||||
|
}
|
||||||
|
|
||||||
return THROTTLE_HIGH;
|
return THROTTLE_HIGH;
|
||||||
}
|
}
|
||||||
|
|
37
src/main/io/serial_1wire.h~HEAD
Normal file
37
src/main/io/serial_1wire.h~HEAD
Normal 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
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue