diff --git a/src/main/io/rc_controls.c b/src/main/io/rc_controls.c index 4b6f8204f3..3264b0269a 100644 --- a/src/main/io/rc_controls.c +++ b/src/main/io/rc_controls.c @@ -113,10 +113,13 @@ bool areSticksInApModePosition(uint16_t ap_mode) 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))) - return THROTTLE_LOW; - else if (!feature(FEATURE_3D) && (rcData[THROTTLE] < rxConfig->mincheck)) - return THROTTLE_LOW; + 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; + } else { + if (rcData[THROTTLE] < rxConfig->mincheck) + return THROTTLE_LOW; + } return THROTTLE_HIGH; } diff --git a/src/main/io/serial_1wire.h~HEAD b/src/main/io/serial_1wire.h~HEAD new file mode 100644 index 0000000000..594cdd43a3 --- /dev/null +++ b/src/main/io/serial_1wire.h~HEAD @@ -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 . + * + * Ported from https://github.com/4712/BLHeliSuite/blob/master/Interfaces/Arduino1Wire/Source/Arduino1Wire_C/Arduino1Wire.c + * by Nathan Tsoi + */ + +#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 diff --git a/src/main/io/serial_1wire.h~a94ce1fef3a5d63c8af6a85b24f8eba2961e0890 b/src/main/io/serial_1wire.h~a94ce1fef3a5d63c8af6a85b24f8eba2961e0890 new file mode 100644 index 0000000000..1e560ed938 --- /dev/null +++ b/src/main/io/serial_1wire.h~a94ce1fef3a5d63c8af6a85b24f8eba2961e0890 @@ -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 . + * + * Ported from https://github.com/4712/BLHeliSuite/blob/master/Interfaces/Arduino1Wire/Source/Arduino1Wire_C/Arduino1Wire.c + * by Nathan Tsoi + */ + +#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