From e783ce5788f6f400f9aed37c241e73f902ee2ade Mon Sep 17 00:00:00 2001 From: pascallanger Date: Fri, 27 Sep 2019 16:20:43 +0200 Subject: [PATCH] Failsafe modification The following protocols are supporting failsafe: FrSkyX, Devo, WK2x01, SFHSS, HISKY/HK310 and AFHDS2A In Serial mode failsafe is configured on the radio itself. In PPM mode and only after the module is up and fully operational, press the bind button for at least 5sec to send the current stick positions as failsafe to the RX. --- Multiprotocol/Common.ino | 22 ---------------------- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/Multiprotocol.ino | 29 ++++++++++++++++++++++++++++- Multiprotocol/_Config.h | 32 ++++++++++---------------------- 4 files changed, 39 insertions(+), 46 deletions(-) diff --git a/Multiprotocol/Common.ino b/Multiprotocol/Common.ino index 8df8439ea..14c05af6e 100644 --- a/Multiprotocol/Common.ino +++ b/Multiprotocol/Common.ino @@ -13,28 +13,6 @@ along with Multiprotocol. If not, see . */ -#ifdef FAILSAFE_ENABLE -//Convert from percentage to failsafe value -#define FAILSAFE_THROTTLE_LOW_VAL (((FAILSAFE_THROTTLE_LOW+125)*1024)/125) -#if FAILSAFE_THROTTLE_LOW_VAL <= 0 - #undef FAILSAFE_THROTTLE_LOW_VAL - #define FAILSAFE_THROTTLE_LOW_VAL 1 -#elif (FAILSAFE_THROTTLE_LOW_VAL) >= 2046 - #undef FAILSAFE_THROTTLE_LOW_VAL - #define FAILSAFE_THROTTLE_LOW_VAL 2046 -#endif -void InitFailsafe() -{ - for(uint8_t i=0;i227) + { //after 5s with PPM frames @22ms + counter=0; + for(uint8_t i=0;i