mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 22:38:14 +00:00
Fix Bind channel
This commit is contained in:
parent
43956bbf2c
commit
6d0e4d5a38
@ -266,10 +266,10 @@ enum MultiPacketTypes {
|
|||||||
#define IS_INPUT_SIGNAL_on ( ( protocol_flags2 & _BV(5) ) !=0 )
|
#define IS_INPUT_SIGNAL_on ( ( protocol_flags2 & _BV(5) ) !=0 )
|
||||||
#define IS_INPUT_SIGNAL_off ( ( protocol_flags2 & _BV(5) ) ==0 )
|
#define IS_INPUT_SIGNAL_off ( ( protocol_flags2 & _BV(5) ) ==0 )
|
||||||
//CH16
|
//CH16
|
||||||
#define CH16_PREV_off protocol_flags2 &= ~_BV(6)
|
#define BIND_CH_PREV_off protocol_flags2 &= ~_BV(6)
|
||||||
#define CH16_PREV_on protocol_flags2 |= _BV(6)
|
#define BIND_CH_PREV_on protocol_flags2 |= _BV(6)
|
||||||
#define IS_CH16_PREV_on ( ( protocol_flags2 & _BV(6) ) !=0 )
|
#define IS_BIND_CH_PREV_on ( ( protocol_flags2 & _BV(6) ) !=0 )
|
||||||
#define IS_CH16_PREV_off ( ( protocol_flags2 & _BV(6) ) ==0 )
|
#define IS_BIND_CH_PREV_off ( ( protocol_flags2 & _BV(6) ) ==0 )
|
||||||
|
|
||||||
//********************
|
//********************
|
||||||
//*** Blink timing ***
|
//*** Blink timing ***
|
||||||
|
@ -483,13 +483,13 @@ void Update_All()
|
|||||||
}
|
}
|
||||||
#endif //ENABLE_PPM
|
#endif //ENABLE_PPM
|
||||||
#ifdef ENABLE_BIND_CH
|
#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
|
{ // Autobind is on and CH16 went up and Throttle is low
|
||||||
CHANGE_PROTOCOL_FLAG_on; //reload protocol to rebind
|
CHANGE_PROTOCOL_FLAG_on; //reload protocol to rebind
|
||||||
CH16_PREV_on;
|
BIND_CH_PREV_on;
|
||||||
}
|
}
|
||||||
if(IS_CH16_PREV_on && Servo_data[15]<PPM_MIN_COMMAND)
|
if(IS_BIND_CH_PREV_on && Servo_data[BIND_CH-1]<PPM_MIN_COMMAND)
|
||||||
CH16_PREV_off;
|
BIND_CH_PREV_off;
|
||||||
#endif //ENABLE_BIND_CH
|
#endif //ENABLE_BIND_CH
|
||||||
if(IS_CHANGE_PROTOCOL_FLAG_on)
|
if(IS_CHANGE_PROTOCOL_FLAG_on)
|
||||||
{ // Protocol needs to be changed or relaunched for bind
|
{ // Protocol needs to be changed or relaunched for bind
|
||||||
|
Loading…
x
Reference in New Issue
Block a user