From 205d728798d44b1b5df7cd59de308336b65619d7 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Wed, 22 Nov 2017 15:21:36 +0100 Subject: [PATCH] S-FHSS Failsafe: SFHSS_FAILSAFE_THROTTLE --- Multiprotocol/SFHSS_cc2500.ino | 15 ++++++++++----- Multiprotocol/_Config.h | 4 ++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/Multiprotocol/SFHSS_cc2500.ino b/Multiprotocol/SFHSS_cc2500.ino index dde3178..7491cac 100644 --- a/Multiprotocol/SFHSS_cc2500.ino +++ b/Multiprotocol/SFHSS_cc2500.ino @@ -157,11 +157,16 @@ static void __attribute__((unused)) SFHSS_build_data_packet() if(command&0x04) {//Failsafe data are coded for sbus: (ch_value-880)/0.625 - ch1=((ch1-880)<<3)/5; - ch2=((ch2-880)<<3)/5; - ch3=((ch3-880)<<3)/5; - if((command&0x08)==0) ch3|=0x800; // Special flag for throttle which appears on dumps... - ch4=((ch4-880)<<3)/5; + #ifndef SFHSS_FAILSAFE_THROTTLE + ch1=((ch1-880)<<3)/5; + ch2=((ch2-880)<<3)/5; + ch3=((ch3-880)<<3)/5; + if((command&0x08)==0) ch3|=0x800; // Special flag for throttle which appears on dumps... + ch4=((ch4-880)<<3)/5; + #else + ch1=1024;ch2=1024;ch4=1024; // All channels centered + ch3=((command&0x08)==0)?0xF70:1024; // except throttle value set to 970 with 0x800 flag set + #endif } // XK [0]=0x81 [3]=0x00 [4]=0x00 diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index c6e6506..11d1905 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -143,6 +143,10 @@ /**************************/ /*** FAILSAFE SETTINGS ***/ /**************************/ +//SHFSS failsafe is by default using the values of channels 9 to 16 +//You can uncomment the setting below to not use channels 9 to 16 but just bring down throttle +//#define SFHSS_FAILSAFE_THROTTLE + #define AFHDS2A_FAILSAFE #ifdef AFHDS2A_FAILSAFE /*