Initial Version of CloneMode (#342)

* Initial Version

* Bugfix and change of the handling of the RX Num.

If RX Num is 63, write a finetune value of 127 to the EEPROM.
A real finetune value of 127 means, the frequency of module is out of range and
the module should be replaced. This way the clone mode should not get unwanted
active by a module with a frequency drift arround 63.
This commit is contained in:
E1yot
2020-04-10 19:01:01 +02:00
committed by GitHub
parent 4039cbf8af
commit 08a555f187
3 changed files with 35 additions and 8 deletions

View File

@@ -105,6 +105,23 @@ void FrSkyX2_init_hop(void)
hopping_frequency[47] = 0; //Bind freq
}
uint8_t hw_ver=0x02;
void Frsky_init_clone(void)
{
uint16_t temp = FRSKY_RX_EEPROM_OFFSET;
temp++;
rx_tx_addr[3] = eeprom_read_byte((EE_ADDR)temp++);
rx_tx_addr[2] = eeprom_read_byte((EE_ADDR)temp++);
hw_ver = eeprom_read_byte((EE_ADDR)temp++);
temp++;
for (uint8_t ch = 0; ch < 47; ch++)
{
hopping_frequency[ch] = eeprom_read_byte((EE_ADDR)temp++);
}
debugln("Clone mode");
}
#endif
/******************************/
/** FrSky V, D and X routines **/