#if defined(FRSKYR9_SX1276_INO) #include "iface_sx1276.h" #define FREQ_MAP_SIZE 29 uint8_t FrSkyR9_step = 1; uint32_t FrSkyR9_freq_map[FREQ_MAP_SIZE]; static void __attribute__((unused)) FrSkyR9_build_packet() { //Header packet[0] = 0x3C; // unknown but constant //ID packet[1] = rx_tx_addr[3]; packet[2] = rx_tx_addr[2]; //Hopping packet[3] = hopping_frequency_no; // current channel index packet[4] = FrSkyR9_step; // step size and last 2 channels start index //RX number packet[5] = RX_num; // receiver number from OpenTX // Set packet[6]=failsafe, packet[7]=0?? and packet[8..19]=channels data FrSkyX_channels(6); //Bind if(IS_BIND_IN_PROGRESS) packet[6] = 0x41; //SPort packet[20] = 0x08; //FrSkyX_TX_Seq=8 at startup packet[21] = 0x00; // length? packet[22] = 0x00; // data1? packet[23] = 0x00; // data2? //CRC uint16_t crc = FrSkyX_crc(packet, 24); packet[24] = crc; // low byte packet[25] = crc >> 8; // high byte } uint16_t initFrSkyR9() { set_rx_tx_addr(MProtocol_id_master); //FrSkyR9_step FrSkyR9_step = 1 + (random(0xfefefefe) % 24); debugln("Step=%d", FrSkyR9_step); //Frequency table uint32_t start_freq=914472960; //915 if(sub_protocol & 0x01) start_freq=859504640; //868 for(uint8_t i=0;i