@@ -21,16 +21,15 @@ Multiprotocol is distributed in the hope that it will be useful,
2121#define FX_INITIAL_WAIT 500
2222#define FX_BIND_COUNT 300 // 3sec
2323#define FX_SWITCH 20
24+ #define FX_NUM_CHANNELS 4
2425
2526#define FX816_PACKET_PERIOD 10000
2627#define FX816_BIND_CHANNEL 40
27- #define FX816_NUM_CHANNELS 4
2828#define FX816_PAYLOAD_SIZE 6
2929
3030#define FX620_PACKET_PERIOD 3250
3131#define FX620_BIND_CHANNEL 18
3232#define FX620_PAYLOAD_SIZE 7
33- #define FX620_NUM_CHANNELS 6
3433
3534#define FORCE_FX620_ID
3635
@@ -40,7 +39,7 @@ static void __attribute__((unused)) FX_send_packet()
4039 if (IS_BIND_DONE)
4140 {
4241 XN297_Hopping (hopping_frequency_no++);
43- hopping_frequency_no %= sub_protocol == FX816 ? FX816_NUM_CHANNELS:FX620_NUM_CHANNELS ;
42+ hopping_frequency_no &= 0x03 ;
4443 }
4544
4645 memset (packet,0x00 ,packet_length);
@@ -122,7 +121,7 @@ static void __attribute__((unused)) FX_initialize_txid()
122121 // I didn't open the plane to find out if I could connect there so this is the best I came up with with few trial and errors...
123122 rx_tx_addr[0 ]=0x35 +(rx_tx_addr[3 ]&0x07 ); // Original dump=0x35
124123 rx_tx_addr[1 ]=0x09 ; // Original dump=0x09
125- memcpy (hopping_frequency," \x09\x1B\x30\x42 " ,FX816_NUM_CHANNELS); // Original dump=9=0x09,27=0x1B,48=0x30,66=0x42
124+ memcpy (hopping_frequency," \x09\x1B\x30\x42 " ,FX816_NUM_CHANNELS); // Original dump=9=0x09,27=0x1B,48=0x30,66=0x42
126125 for (uint8_t i=0 ;i<FX816_NUM_CHANNELS;i++)
127126 hopping_frequency[i]+=rx_tx_addr[3 ]&0x07 ;
128127
@@ -135,14 +134,12 @@ static void __attribute__((unused)) FX_initialize_txid()
135134 hopping_frequency[0 ] = 0x18 + rx_tx_addr[3 ]&0x07 ; // just to try something
136135 #ifdef FORCE_FX620_ID
137136 memcpy (rx_tx_addr,(uint8_t *)" \x34\xA9\x32 " ,3 );
138- hopping_frequency[0 ] = 0x18 ; // on dump: 24 34 40 44 50 54
137+ hopping_frequency[0 ] = 0x18 ; // on dump: 24 34 44 54
139138 #endif
140139 // no idea if this is true...
141140 hopping_frequency[1 ] = 10 + hopping_frequency[0 ];
142- hopping_frequency[2 ] = 16 + hopping_frequency[0 ];
143- hopping_frequency[3 ] = 20 + hopping_frequency[0 ];
144- hopping_frequency[4 ] = 26 + hopping_frequency[0 ];
145- hopping_frequency[5 ] = 30 + hopping_frequency[0 ];
141+ hopping_frequency[2 ] = 20 + hopping_frequency[0 ];
142+ hopping_frequency[3 ] = 30 + hopping_frequency[0 ];
146143
147144 packet_length = FX620_PAYLOAD_SIZE;
148145 packet_period = FX620_PACKET_PERIOD;
0 commit comments