1717
1818#include " iface_nrf24l01.h"
1919
20- #define CG022_PACKET_PERIOD 2315
20+ #define CG022_PACKET_PERIOD 2310
21+ #define CG022_BIND_START_DELAY 15614
2122#define CG022_BIND_COUNT 166
2223#define CG022_PACKET_SIZE 10
2324#define CG022_RF_CHANNEL_COUNT 8
2425
25- static const uint8_t PROGMEM CG022_hop[] = { 0x0A , 0x32 , 0x14 , 0x3C , 0x1E , 0x46 , 0x00 , 0x28 };
26+ #define CG022_HOP_START_INDEX 1
27+ static const uint8_t PROGMEM CG022_hop[] = { 0x00 , 0x28 , 0x0A , 0x32 , 0x14 , 0x3C , 0x1E , 0x46 };
2628static const uint8_t CG022_addr[] = { 0x5A , 0x5A , 0x00 , 0x33 };
2729static const uint8_t CG022_bind_id[] = { 0x00 , 0x11 , 0x22 , 0x33 };
30+ static uint8_t CG022_startup_delay_done;
2831
2932static uint8_t CG022_scale_channel (uint8_t channel)
3033{
@@ -95,6 +98,11 @@ uint16_t CG022_callback()
9598 #ifdef MULTI_SYNC
9699 telemetry_set_input_sync (CG022_PACKET_PERIOD);
97100 #endif
101+ if (!CG022_startup_delay_done)
102+ {
103+ CG022_startup_delay_done = 1 ;
104+ return CG022_BIND_START_DELAY;
105+ }
98106 if (bind_counter)
99107 {
100108 bind_counter--;
@@ -109,7 +117,8 @@ void CG022_init(void)
109117{
110118 BIND_IN_PROGRESS; // autobind protocol
111119 bind_counter = CG022_BIND_COUNT;
112- hopping_frequency_no = 0 ;
120+ hopping_frequency_no = CG022_HOP_START_INDEX;
121+ CG022_startup_delay_done = 0 ;
113122 CG022_RF_init ();
114123 packet_period = CG022_PACKET_PERIOD;
115124}
0 commit comments