/* This project is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. Multiprotocol is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with Multiprotocol. If not, see . */ // Compatible with FEI XIONG P38 plane. #if defined(FX816_NRF24L01_INO) #include "iface_xn297.h" #define FX816_INITIAL_WAIT 500 #define FX816_PACKET_PERIOD 10000 #define FX816_RF_BIND_CHANNEL 0x28 //40 #define FX816_RF_NUM_CHANNELS 4 #define FX816_PAYLOAD_SIZE 6 #define FX816_BIND_COUNT 300 //3sec static void __attribute__((unused)) FX816_send_packet() { if(IS_BIND_IN_PROGRESS) packet[0] = 0x55; else { XN297_Hopping(hopping_frequency_no++); hopping_frequency_no%=FX816_RF_NUM_CHANNELS; packet[0] = 0xAA; } packet[1] = rx_tx_addr[0]; packet[2] = rx_tx_addr[1]; uint8_t val=convert_channel_8b(AILERON); #define FX816_SWITCH 20 if(val>127+FX816_SWITCH) packet[3] = 1; else if(val<127-FX816_SWITCH) packet[3] = 2; else packet[3] = 0; packet[4] = convert_channel_16b_limit(THROTTLE,0,100); val=0; for(uint8_t i=0;i