diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index ff498b9..06c0231 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 2 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 50 +#define VERSION_PATCH_LEVEL 51 //****************** // Protocols diff --git a/Multiprotocol/WFLY_cyrf6936.ino b/Multiprotocol/WFLY_cyrf6936.ino index ddc59d2..1742768 100644 --- a/Multiprotocol/WFLY_cyrf6936.ino +++ b/Multiprotocol/WFLY_cyrf6936.ino @@ -155,6 +155,9 @@ uint16_t ReadWFLY() uint8_t status,len,sum=0,check=0; uint8_t start; static uint8_t retry; + #ifdef USE_CYRF6936_CH15_TUNING + static uint16_t Channel15=1024; + #endif switch(phase) { @@ -236,6 +239,15 @@ uint16_t ReadWFLY() while ((uint8_t)((uint8_t)micros()-(uint8_t)start) < 200) if((CYRF_ReadRegister(CYRF_02_TX_CTRL) & 0x80) == 0x00) break; // Packet transmission complete + #ifdef USE_CYRF6936_CH15_TUNING + if(Channel15!=Channel_data[CH15]) + { // adjust frequency + Channel15=Channel_data[CH15]+0x155; // default value is 0x555 = 0x400 + 0x155 + CYRF_WriteRegister(CYRF_1B_TX_OFFSET_LSB, Channel15&0xFF); + CYRF_WriteRegister(CYRF_1C_TX_OFFSET_MSB, Channel15>>8); + Channel15-=0x155; + } + #endif return WFLY_send_data_packet(); } return 1000; @@ -253,7 +265,7 @@ uint16_t initWFLY() rx_tx_addr[2]=0xBF; // ID rx_tx_addr[3]=0x13; // ID ch=0x16; // value seen between 0x0A and 0x17 - rc_ch_num=0x15 // RF channel to send the current hopping table + rf_ch_num=0x15 // RF channel to send the current hopping table #endif debug("ID:") diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 7116405..808a54d 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -109,6 +109,12 @@ //#define FORCE_AFHDS2A_TUNING 0 //#define FORCE_BUGS_TUNING 0 +/** CYRF6936 Fine Frequency Tuning **/ +//This is required in rare cases where some CYRF6936 modules and/or RXs have an inaccurate crystal oscillator. +//If using Serial mode only (for now), you can use CH15 to find the right tuning value. -100%=-300, 0%=default 0, +100%=+300. +//Uncomment the line below (remove the "//") to enable this feature. +//#define USE_CYRF6936_CH15_TUNING + /** Low Power **/ //Low power is reducing the transmit power of the multi module. This setting is configurable per model in PPM (table below) or Serial mode (radio GUI). //It can be activated when flying indoor or small models since the distance is short or if a model is causing issues when flying closed to the TX.