mirror of
https://github.com/pascallanger/DIY-Multiprotocol-TX-Module.git
synced 2025-02-04 20:08:11 +00:00
FrSkyR9: fix independant compilation issue
This commit is contained in:
parent
63dd8a9215
commit
49d993f613
@ -17,8 +17,9 @@
|
||||
/** FrSky D and X routines **/
|
||||
/******************************/
|
||||
|
||||
#if defined(FRSKYD_CC2500_INO) || defined(FRSKYX_CC2500_INO) || defined(FRSKYX_CC2500_INO) || defined(FRSKYL_CC2500_INO) || defined(FRSKY_RX_CC2500_INO) || defined(FRSKYR9_SX1276_INO)
|
||||
#if defined(FRSKYD_CC2500_INO) || defined(FRSKYX_CC2500_INO) || defined(FRSKYL_CC2500_INO) || defined(FRSKY_RX_CC2500_INO) || defined(FRSKYR9_SX1276_INO)
|
||||
uint8_t FrSkyFormat=0;
|
||||
uint8_t FrSkyX_chanskip;
|
||||
#endif
|
||||
|
||||
#if defined(FRSKYX_CC2500_INO) || defined(FRSKYL_CC2500_INO) || defined(FRSKY_RX_CC2500_INO) || defined(FRSKYR9_SX1276_INO)
|
||||
@ -380,21 +381,22 @@ void Frsky_init_clone(void)
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(FRSKYX_CC2500_INO) || defined(FRSKYL_CC2500_INO)
|
||||
uint8_t FrSkyX_chanskip;
|
||||
#if defined(FRSKYX_CC2500_INO) || defined(FRSKYL_CC2500_INO) || defined(FRSKYR9_SX1276_INO)
|
||||
uint8_t FrSkyX_TX_Seq, FrSkyX_TX_IN_Seq;
|
||||
uint8_t FrSkyX_RX_Seq ;
|
||||
|
||||
#ifdef SPORT_SEND
|
||||
struct t_FrSkyX_TX_Frame
|
||||
{
|
||||
uint8_t count;
|
||||
uint8_t payload[8];
|
||||
} ;
|
||||
// Store FrskyX telemetry
|
||||
struct t_FrSkyX_TX_Frame FrSkyX_TX_Frames[4] ;
|
||||
#ifdef SPORT_SEND
|
||||
struct t_FrSkyX_TX_Frame
|
||||
{
|
||||
uint8_t count;
|
||||
uint8_t payload[8];
|
||||
} ;
|
||||
// Store FrskyX telemetry
|
||||
struct t_FrSkyX_TX_Frame FrSkyX_TX_Frames[4] ;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(FRSKYX_CC2500_INO) || defined(FRSKYL_CC2500_INO)
|
||||
static void __attribute__((unused)) FrSkyX_set_start(uint8_t ch )
|
||||
{
|
||||
CC2500_Strobe(CC2500_SIDLE);
|
||||
|
@ -3,7 +3,6 @@
|
||||
|
||||
#define FREQ_MAP_SIZE 29
|
||||
|
||||
uint8_t FrSkyR9_step = 1;
|
||||
uint32_t FrSkyR9_freq_map[FREQ_MAP_SIZE];
|
||||
|
||||
enum {
|
||||
@ -24,10 +23,10 @@ static void __attribute__((unused)) FrSkyR9_build_freq()
|
||||
debugln("F%d=%lu", i, FrSkyR9_freq_map[i]);
|
||||
start_freq+=0x7A000;
|
||||
}
|
||||
// Last two frequencies determined by FrSkyR9_step
|
||||
FrSkyR9_freq_map[FREQ_MAP_SIZE-2] = FrSkyR9_freq_map[FrSkyR9_step];
|
||||
// Last two frequencies determined by FrSkyX_chanskip
|
||||
FrSkyR9_freq_map[FREQ_MAP_SIZE-2] = FrSkyR9_freq_map[FrSkyX_chanskip];
|
||||
debugln("F%d=%lu", FREQ_MAP_SIZE-2, FrSkyR9_freq_map[FREQ_MAP_SIZE-2]);
|
||||
FrSkyR9_freq_map[FREQ_MAP_SIZE-1] = FrSkyR9_freq_map[FrSkyR9_step+1];
|
||||
FrSkyR9_freq_map[FREQ_MAP_SIZE-1] = FrSkyR9_freq_map[FrSkyX_chanskip+1];
|
||||
debugln("F%d=%lu", FREQ_MAP_SIZE-1, FrSkyR9_freq_map[FREQ_MAP_SIZE-1]);
|
||||
hopping_frequency_no = 0;
|
||||
}
|
||||
@ -41,7 +40,7 @@ static void __attribute__((unused)) FrSkyR9_build_packet()
|
||||
|
||||
//Hopping
|
||||
packet[3] = hopping_frequency_no; // current channel index
|
||||
packet[4] = FrSkyR9_step; // step size and last 2 channels start index
|
||||
packet[4] = FrSkyX_chanskip; // step size and last 2 channels start index
|
||||
|
||||
//RX number
|
||||
packet[5] = RX_num; // receiver number from OpenTX
|
||||
@ -81,9 +80,9 @@ uint16_t initFrSkyR9()
|
||||
{
|
||||
set_rx_tx_addr(MProtocol_id_master);
|
||||
|
||||
//FrSkyR9_step
|
||||
FrSkyR9_step = 1 + (random(0xfefefefe) % 24);
|
||||
debugln("Step=%d", FrSkyR9_step);
|
||||
//FrSkyX_chanskip
|
||||
FrSkyX_chanskip = 1 + (random(0xfefefefe) % 24);
|
||||
debugln("Step=%d", FrSkyX_chanskip);
|
||||
|
||||
//Frequency table
|
||||
FrSkyR9_build_freq();
|
||||
@ -142,7 +141,7 @@ uint16_t FrSkyR9_callback()
|
||||
if(bind && IS_BIND_DONE)
|
||||
FrSkyR9_build_freq();
|
||||
bind=IS_BIND_IN_PROGRESS;
|
||||
hopping_frequency_no = (hopping_frequency_no + FrSkyR9_step) % FREQ_MAP_SIZE;
|
||||
hopping_frequency_no = (hopping_frequency_no + FrSkyX_chanskip) % FREQ_MAP_SIZE;
|
||||
SX1276_SetFrequency(FrSkyR9_freq_map[hopping_frequency_no]); // set current center frequency
|
||||
//Set power
|
||||
// max power: 15dBm (10.8 + 0.6 * MaxPower [dBm])
|
||||
|
@ -201,6 +201,7 @@
|
||||
#define CC2500_INSTALLED
|
||||
#define NRF24L01_INSTALLED
|
||||
#define SX1276_INSTALLED
|
||||
#undef ENABLE_PPM
|
||||
#endif
|
||||
|
||||
//Make sure protocols are selected correctly
|
||||
|
Loading…
x
Reference in New Issue
Block a user