From 6d0e4d5a38f0445f34fbf8b81b3d9d224f9fd6aa Mon Sep 17 00:00:00 2001 From: pascallanger Date: Mon, 2 Jan 2017 18:22:03 +0100 Subject: [PATCH] Fix Bind channel --- Multiprotocol/Multiprotocol.h | 8 ++++---- Multiprotocol/Multiprotocol.ino | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index d852b14..2b577e3 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -266,10 +266,10 @@ enum MultiPacketTypes { #define IS_INPUT_SIGNAL_on ( ( protocol_flags2 & _BV(5) ) !=0 ) #define IS_INPUT_SIGNAL_off ( ( protocol_flags2 & _BV(5) ) ==0 ) //CH16 -#define CH16_PREV_off protocol_flags2 &= ~_BV(6) -#define CH16_PREV_on protocol_flags2 |= _BV(6) -#define IS_CH16_PREV_on ( ( protocol_flags2 & _BV(6) ) !=0 ) -#define IS_CH16_PREV_off ( ( protocol_flags2 & _BV(6) ) ==0 ) +#define BIND_CH_PREV_off protocol_flags2 &= ~_BV(6) +#define BIND_CH_PREV_on protocol_flags2 |= _BV(6) +#define IS_BIND_CH_PREV_on ( ( protocol_flags2 & _BV(6) ) !=0 ) +#define IS_BIND_CH_PREV_off ( ( protocol_flags2 & _BV(6) ) ==0 ) //******************** //*** Blink timing *** diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index be34f1e..7300f65 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -483,13 +483,13 @@ void Update_All() } #endif //ENABLE_PPM #ifdef ENABLE_BIND_CH - if(IS_AUTOBIND_FLAG_on && IS_CH16_PREV_off && Servo_data[BIND_CH-1]>PPM_MAX_COMMAND && Servo_data[THROTTLE]<(servo_min_100+25)) + if(IS_AUTOBIND_FLAG_on && IS_BIND_CH_PREV_off && Servo_data[BIND_CH-1]>PPM_MAX_COMMAND && Servo_data[THROTTLE]<(servo_min_100+25)) { // Autobind is on and CH16 went up and Throttle is low CHANGE_PROTOCOL_FLAG_on; //reload protocol to rebind - CH16_PREV_on; + BIND_CH_PREV_on; } - if(IS_CH16_PREV_on && Servo_data[15]