mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2026-01-08 17:13:17 +00:00
New feature: end bind
This new feature is available: - in serial mode and when binding from the GUI. As soon as the Bind window is closed = serial bind bit was set and cleared, the current bind operation will be terminated. - if the bind was initiated from the Bind on channel feature (bind channel goes high) then as soon as the bind channel goes low the current bind operation will be terminated. Tested on ersky9x which does open a bind window, not sure about OpenTX... Some protocols (Hubsan, Assan, FY326, Shenqi...) which are waiting for model/RX to reply will stay in bind mode.
This commit is contained in:
@@ -252,19 +252,18 @@ uint16_t ReadV2x2()
|
||||
return 150;
|
||||
break;
|
||||
case V202_BIND2:
|
||||
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED) {
|
||||
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED)
|
||||
return V2X2_PACKET_CHKTIME;
|
||||
}
|
||||
V2X2_send_packet(1);
|
||||
if (--counter == 0) {
|
||||
if (--bind_counter == 0)
|
||||
{
|
||||
phase = V202_DATA;
|
||||
BIND_DONE;
|
||||
}
|
||||
break;
|
||||
case V202_DATA:
|
||||
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED) {
|
||||
if (packet_sent && NRF24L01_packet_ack() != PKT_ACKED)
|
||||
return V2X2_PACKET_CHKTIME;
|
||||
}
|
||||
V2X2_send_packet(0);
|
||||
break;
|
||||
}
|
||||
@@ -278,7 +277,7 @@ uint16_t initV2x2()
|
||||
//
|
||||
if (IS_AUTOBIND_FLAG_on)
|
||||
{
|
||||
counter = V2X2_BIND_COUNT;
|
||||
bind_counter = V2X2_BIND_COUNT;
|
||||
phase = V202_INIT2;
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user