WFLY: renamed WFLYRF to WFLY2

This commit is contained in:
Pascal Langer 2020-12-13 23:15:43 +01:00
parent ef5d9cb6b3
commit 1bb059c2a2
9 changed files with 90 additions and 88 deletions

View File

@ -176,3 +176,4 @@
8,4,YD717,NiHui,1,Flip,Light,Pict,Video,HLess 8,4,YD717,NiHui,1,Flip,Light,Pict,Video,HLess
52,0,ZSX,280,1,Light 52,0,ZSX,280,1,Light
78,0,M-Link,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16 78,0,M-Link,Std,0,CH5,CH6,CH7,CH8,CH9,CH10,CH11,CH12,CH13,CH14,CH15,CH16
79,0,WFLY2,RF20x,0,CH5,CH6,CH7,CH8,CH9,CH10

View File

@ -27,7 +27,7 @@ void A7105_WriteData(uint8_t len, uint8_t channel)
for (i = 0; i < len; i++) for (i = 0; i < len; i++)
SPI_Write(packet[i]); SPI_Write(packet[i]);
A7105_CSN_on; A7105_CSN_on;
if(protocol!=PROTO_WFLYRF) if(protocol!=PROTO_WFLY2)
{ {
if(!(protocol==PROTO_FLYSKY || protocol==PROTO_KYOSHO)) if(!(protocol==PROTO_FLYSKY || protocol==PROTO_KYOSHO))
{ {
@ -210,9 +210,9 @@ void A7105_AdjustLOBaseFreq(uint8_t cmd)
offset=(int16_t)FORCE_KYOSHO_TUNING; offset=(int16_t)FORCE_KYOSHO_TUNING;
#endif #endif
break; break;
case PROTO_WFLYRF: case PROTO_WFLY2:
#ifdef FORCE_WFLYRF_TUNING #ifdef FORCE_WFLY2_TUNING
offset=(int16_t)FORCE_WFLYRF_TUNING; offset=(int16_t)FORCE_WFLY2_TUNING;
#endif #endif
break; break;
case PROTO_AFHDS2A: case PROTO_AFHDS2A:
@ -333,8 +333,8 @@ const uint8_t PROGMEM KYOSHO_HYPE_A7105_regs[] = {
0x01, 0x0f // 30 - 31 0x01, 0x0f // 30 - 31
}; };
#endif #endif
#ifdef WFLYRF_A7105_INO //A7106 values #ifdef WFLY2_A7105_INO //A7106 values
const uint8_t PROGMEM WFLYRF_A7105_regs[] = { const uint8_t PROGMEM WFLY2_A7105_regs[] = {
0xff, 0x62, 0xff, 0x1F, 0x40, 0xff, 0xff ,0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x05, 0x00, 0x64, // 00 - 0f Changes: 0B:19->33, 0C:01,33 0xff, 0x62, 0xff, 0x1F, 0x40, 0xff, 0xff ,0x00, 0x00, 0x00, 0x00, 0x33, 0x33, 0x05, 0x00, 0x64, // 00 - 0f Changes: 0B:19->33, 0C:01,33
0x9e, 0x4b, 0x00, 0x02, 0x16, 0x2b, 0x12, 0x40, 0x62, 0x80, 0x80, 0x00, 0x0a, 0x32, 0x03, 0x0f, // 10 - 1f 1C:4A->0A 0x9e, 0x4b, 0x00, 0x02, 0x16, 0x2b, 0x12, 0x40, 0x62, 0x80, 0x80, 0x00, 0x0a, 0x32, 0x03, 0x0f, // 10 - 1f 1C:4A->0A
0x12, 0x00, 0x00, 0xff, 0x00, 0x00, 0x23, 0x70, 0x15, 0x47, 0x80, 0x03, 0x01, 0x45, 0x18, 0x00, // 20 - 2f 2B:77->03, 2E:19->18 0x12, 0x00, 0x00, 0xff, 0x00, 0x00, 0x23, 0x70, 0x15, 0x47, 0x80, 0x03, 0x01, 0x45, 0x18, 0x00, // 20 - 2f 2B:77->03, 2E:19->18
@ -349,10 +349,10 @@ void A7105_Init(void)
uint8_t *A7105_Regs=0; uint8_t *A7105_Regs=0;
uint8_t vco_calibration0, vco_calibration1; uint8_t vco_calibration0, vco_calibration1;
#ifdef WFLYRF_A7105_INO #ifdef WFLY2_A7105_INO
if(protocol==PROTO_WFLYRF) if(protocol==PROTO_WFLY2)
{ {
A7105_Regs=(uint8_t*)WFLYRF_A7105_regs; A7105_Regs=(uint8_t*)WFLY2_A7105_regs;
} }
else else
#endif #endif
@ -465,7 +465,7 @@ void A7105_Init(void)
while(A7105_ReadReg(A7105_02_CALC)); // Wait for calibration to end while(A7105_ReadReg(A7105_02_CALC)); // Wait for calibration to end
vco_calibration1 = A7105_ReadReg(A7105_25_VCO_SBCAL_I); vco_calibration1 = A7105_ReadReg(A7105_25_VCO_SBCAL_I);
if(protocol==PROTO_BUGS || protocol==PROTO_WFLYRF) if(protocol==PROTO_BUGS || protocol==PROTO_WFLY2)
A7105_SetVCOBand(vco_calibration0 & 0x07, vco_calibration1 & 0x07); // Set calibration band value to best match A7105_SetVCOBand(vco_calibration0 & 0x07, vco_calibration1 & 0x07); // Set calibration band value to best match
else else
if(protocol!=PROTO_HUBSAN) if(protocol!=PROTO_HUBSAN)

View File

@ -59,7 +59,8 @@ const char STR_H8_3D[] ="H8 3D";
const char STR_CORONA[] ="Corona"; const char STR_CORONA[] ="Corona";
const char STR_CFLIE[] ="CFlie"; const char STR_CFLIE[] ="CFlie";
const char STR_HITEC[] ="Hitec"; const char STR_HITEC[] ="Hitec";
const char STR_WFLY[] ="WFly"; const char STR_WFLY[] ="WFLY";
const char STR_WFLY2[] ="WFLY2";
const char STR_BUGS[] ="Bugs"; const char STR_BUGS[] ="Bugs";
const char STR_BUGSMINI[] ="BugMini"; const char STR_BUGSMINI[] ="BugMini";
const char STR_TRAXXAS[] ="Traxxas"; const char STR_TRAXXAS[] ="Traxxas";
@ -141,7 +142,7 @@ const char STR_SUBTYPE_PROPEL[] = "\x04""74-Z";
const char STR_SUBTYPE_FRSKY_RX[] = "\x07""RX\0 ""CloneTX"; const char STR_SUBTYPE_FRSKY_RX[] = "\x07""RX\0 ""CloneTX";
const char STR_SUBTYPE_FRSKYL[] = "\x08""LR12\0 ""LR12 6ch"; const char STR_SUBTYPE_FRSKYL[] = "\x08""LR12\0 ""LR12 6ch";
const char STR_SUBTYPE_WFLY[] = "\x05""WFR0x"; const char STR_SUBTYPE_WFLY[] = "\x05""WFR0x";
const char STR_SUBTYPE_WFLYRF[] = "\x05""RF20x"; const char STR_SUBTYPE_WFLY2[] = "\x05""RF20x";
const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync"; const char STR_SUBTYPE_HOTT[] = "\x07""Sync\0 ""No_Sync";
const char STR_SUBTYPE_PELIKAN[] = "\x04""Pro\0""Lite"; const char STR_SUBTYPE_PELIKAN[] = "\x04""Pro\0""Lite";
const char STR_SUBTYPE_V761[] = "\x03""3ch""4ch"; const char STR_SUBTYPE_V761[] = "\x03""3ch""4ch";
@ -385,8 +386,8 @@ const mm_protocol_definition multi_protocols[] = {
#if defined(WFLY_CYRF6936_INO) #if defined(WFLY_CYRF6936_INO)
{PROTO_WFLY, STR_WFLY, 1, STR_SUBTYPE_WFLY, OPTION_NONE }, {PROTO_WFLY, STR_WFLY, 1, STR_SUBTYPE_WFLY, OPTION_NONE },
#endif #endif
#if defined(WFLYRF_A7105_INO) #if defined(WFLY2_A7105_INO)
{PROTO_WFLYRF, STR_WFLY, 1, STR_SUBTYPE_WFLYRF, OPTION_NONE }, {PROTO_WFLY2, STR_WFLY2, 1, STR_SUBTYPE_WFLY2, OPTION_NONE },
#endif #endif
#if defined(XK_NRF24L01_INO) #if defined(XK_NRF24L01_INO)
{PROTO_XK, STR_XK , 2, STR_SUBTYPE_XK, OPTION_RFTUNE }, {PROTO_XK, STR_XK , 2, STR_SUBTYPE_XK, OPTION_RFTUNE },

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1 #define VERSION_MAJOR 1
#define VERSION_MINOR 3 #define VERSION_MINOR 3
#define VERSION_REVISION 1 #define VERSION_REVISION 1
#define VERSION_PATCH_LEVEL 82 #define VERSION_PATCH_LEVEL 83
//****************** //******************
// Protocols // Protocols
@ -104,7 +104,7 @@ enum PROTOCOLS
PROTO_REALACC = 76, // =>NRF24L01 PROTO_REALACC = 76, // =>NRF24L01
PROTO_OMP = 77, // =>CC2500 & NRF24L01 PROTO_OMP = 77, // =>CC2500 & NRF24L01
PROTO_MLINK = 78, // =>CYRF6936 PROTO_MLINK = 78, // =>CYRF6936
PROTO_WFLYRF = 79, // =>A7105 PROTO_WFLY2 = 79, // =>A7105
PROTO_NANORF = 126, // =>NRF24L01 PROTO_NANORF = 126, // =>NRF24L01
PROTO_TEST = 127, // =>CC2500 PROTO_TEST = 127, // =>CC2500
@ -837,7 +837,7 @@ Serial: 100000 Baud 8e2 _ xxxx xxxx p --
REALACC 76 REALACC 76
OMP 77 OMP 77
MLINK 78 MLINK 78
WFLYRF 79 WFLY2 79
BindBit=> 0x80 1=Bind/0=No BindBit=> 0x80 1=Bind/0=No
AutoBindBit=> 0x40 1=Yes /0=No AutoBindBit=> 0x40 1=Yes /0=No
RangeCheck=> 0x20 1=Yes /0=No RangeCheck=> 0x20 1=Yes /0=No

View File

@ -821,7 +821,7 @@ bool Update_All()
update_led_status(); update_led_status();
#if defined(TELEMETRY) #if defined(TELEMETRY)
#if ( !( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) ) ) #if ( !( defined(MULTI_TELEMETRY) || defined(MULTI_STATUS) ) )
if((protocol == PROTO_BAYANG_RX) || (protocol == PROTO_AFHDS2A_RX) || (protocol == PROTO_FRSKY_RX) || (protocol == PROTO_SCANNER) || (protocol==PROTO_FRSKYD) || (protocol==PROTO_BAYANG) || (protocol==PROTO_NCC1701) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_FRSKYX) || (protocol==PROTO_FRSKYX2) || (protocol==PROTO_DSM) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_HOTT) || (protocol==PROTO_PROPEL) || (protocol==PROTO_OMP) || (protocol==PROTO_DEVO) || (protocol==PROTO_DSM_RX) || (protocol==PROTO_FRSKY_R9) || (protocol==PROTO_RLINK) || (protocol==PROTO_WFLYRF)) if((protocol == PROTO_BAYANG_RX) || (protocol == PROTO_AFHDS2A_RX) || (protocol == PROTO_FRSKY_RX) || (protocol == PROTO_SCANNER) || (protocol==PROTO_FRSKYD) || (protocol==PROTO_BAYANG) || (protocol==PROTO_NCC1701) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_FRSKYX) || (protocol==PROTO_FRSKYX2) || (protocol==PROTO_DSM) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_HOTT) || (protocol==PROTO_PROPEL) || (protocol==PROTO_OMP) || (protocol==PROTO_DEVO) || (protocol==PROTO_DSM_RX) || (protocol==PROTO_FRSKY_R9) || (protocol==PROTO_RLINK) || (protocol==PROTO_WFLY2))
#endif #endif
if(IS_DISABLE_TELEM_off) if(IS_DISABLE_TELEM_off)
TelemetryUpdate(); TelemetryUpdate();
@ -1196,11 +1196,11 @@ static void protocol_init()
remote_callback = ReadKyosho; remote_callback = ReadKyosho;
break; break;
#endif #endif
#if defined(WFLYRF_A7105_INO) #if defined(WFLY2_A7105_INO)
case PROTO_WFLYRF: case PROTO_WFLY2:
PE1_off; //antenna RF1 PE1_off; //antenna RF1
next_callback = initWFLYRF(); next_callback = initWFLY2();
remote_callback = ReadWFLYRF; remote_callback = ReadWFLY2;
break; break;
#endif #endif
#endif #endif
@ -2290,7 +2290,7 @@ void pollBoot()
#if defined(TELEMETRY) #if defined(TELEMETRY)
void PPM_Telemetry_serial_init() void PPM_Telemetry_serial_init()
{ {
if( (protocol==PROTO_FRSKYD) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_BAYANG)|| (protocol==PROTO_NCC1701) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_PROPEL) || (protocol==PROTO_OMP) || (protocol==PROTO_RLINK) || (protocol==PROTO_WFLYRF) if( (protocol==PROTO_FRSKYD) || (protocol==PROTO_HUBSAN) || (protocol==PROTO_AFHDS2A) || (protocol==PROTO_BAYANG)|| (protocol==PROTO_NCC1701) || (protocol==PROTO_CABELL) || (protocol==PROTO_HITEC) || (protocol==PROTO_BUGS) || (protocol==PROTO_BUGSMINI) || (protocol==PROTO_PROPEL) || (protocol==PROTO_OMP) || (protocol==PROTO_RLINK) || (protocol==PROTO_WFLY2)
#ifdef TELEMETRY_FRSKYX_TO_FRSKYD #ifdef TELEMETRY_FRSKYX_TO_FRSKYD
|| (protocol==PROTO_FRSKYX) || (protocol==PROTO_FRSKYX2) || (protocol==PROTO_FRSKYX) || (protocol==PROTO_FRSKYX2)
#endif #endif

View File

@ -531,7 +531,7 @@ void frsky_link_frame()
telemetry_link |= 2 ; // Send hub if available telemetry_link |= 2 ; // Send hub if available
} }
else else
{//PROTO_HUBSAN, PROTO_AFHDS2A, PROTO_BAYANG, PROTO_NCC1701, PROTO_CABELL, PROTO_HITEC, PROTO_BUGS, PROTO_BUGSMINI, PROTO_FRSKYX, PROTO_FRSKYX2, PROTO_PROPEL, PROTO_DEVO, PROTO_RLINK, PROTO_OMP, PROTO_WFLYRF {//PROTO_HUBSAN, PROTO_AFHDS2A, PROTO_BAYANG, PROTO_NCC1701, PROTO_CABELL, PROTO_HITEC, PROTO_BUGS, PROTO_BUGSMINI, PROTO_FRSKYX, PROTO_FRSKYX2, PROTO_PROPEL, PROTO_DEVO, PROTO_RLINK, PROTO_OMP, PROTO_WFLY2
frame[1] = v_lipo1; frame[1] = v_lipo1;
frame[2] = v_lipo2; frame[2] = v_lipo2;
frame[3] = RX_RSSI; frame[3] = RX_RSSI;

View File

@ -160,9 +160,9 @@
#error "The Kyosho forced frequency tuning value is outside of the range -300..300." #error "The Kyosho forced frequency tuning value is outside of the range -300..300."
#endif #endif
#endif #endif
#ifdef FORCE_WFLYRF_TUNING #ifdef FORCE_WFLY2_TUNING
#if ( FORCE_WFLYRF_TUNING < -300 ) || ( FORCE_WFLYRF_TUNING > 300 ) #if ( FORCE_WFLY2_TUNING < -300 ) || ( FORCE_WFLY2_TUNING > 300 )
#error "The WFLYRF forced frequency tuning value is outside of the range -300..300." #error "The WFLY2 forced frequency tuning value is outside of the range -300..300."
#endif #endif
#endif #endif
@ -182,8 +182,8 @@
#ifndef FORCE_KYOSHO_TUNING #ifndef FORCE_KYOSHO_TUNING
#define FORCE_KYOSHO_TUNING 0 #define FORCE_KYOSHO_TUNING 0
#endif #endif
#ifndef FORCE_WFLYRF_TUNING #ifndef FORCE_WFLY2_TUNING
#define FORCE_WFLYRF_TUNING 0 #define FORCE_WFLY2_TUNING 0
#endif #endif
#ifndef FORCE_HUBSAN_TUNING #ifndef FORCE_HUBSAN_TUNING
#define FORCE_HUBSAN_TUNING 0 #define FORCE_HUBSAN_TUNING 0
@ -235,7 +235,7 @@
#undef HUBSAN_A7105_INO #undef HUBSAN_A7105_INO
#undef KYOSHO_A7105_INO #undef KYOSHO_A7105_INO
#undef PELIKAN_A7105_INO #undef PELIKAN_A7105_INO
#undef WFLYRF_A7105_INO #undef WFLY2_A7105_INO
#endif #endif
#ifndef CYRF6936_INSTALLED #ifndef CYRF6936_INSTALLED
#undef DEVO_CYRF6936_INO #undef DEVO_CYRF6936_INO
@ -355,7 +355,7 @@
#undef RLINK_HUB_TELEMETRY #undef RLINK_HUB_TELEMETRY
#undef DSM_RX_CYRF6936_INO #undef DSM_RX_CYRF6936_INO
#undef DSM_FWD_PGM #undef DSM_FWD_PGM
#undef WFLYRF_HUB_TELEMETRY #undef WFLY2_HUB_TELEMETRY
#else #else
#if defined(MULTI_TELEMETRY) && defined(MULTI_STATUS) #if defined(MULTI_TELEMETRY) && defined(MULTI_STATUS)
#error You should choose either MULTI_TELEMETRY or MULTI_STATUS but not both. #error You should choose either MULTI_TELEMETRY or MULTI_STATUS but not both.
@ -427,10 +427,10 @@
#if not defined(HOTT_CC2500_INO) #if not defined(HOTT_CC2500_INO)
#undef HOTT_FW_TELEMETRY #undef HOTT_FW_TELEMETRY
#endif #endif
#if not defined(WFLYRF_A7105_INO) #if not defined(WFLY2_A7105_INO)
#undef WFLYRF_HUB_TELEMETRY #undef WFLY2_HUB_TELEMETRY
#endif #endif
#if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(RLINK_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY) && not defined(BAYANG_RX_TELEMETRY) && not defined(DEVO_HUB_TELEMETRY) && not defined(PROPEL_HUB_TELEMETRY) && not defined(OMP_HUB_TELEMETRY) && not defined(WFLYRF_HUB_TELEMETRY) #if not defined(HOTT_FW_TELEMETRY) && not defined(DSM_TELEMETRY) && not defined(SPORT_TELEMETRY) && not defined(HUB_TELEMETRY) && not defined(HUBSAN_HUB_TELEMETRY) && not defined(BUGS_HUB_TELEMETRY) && not defined(NCC1701_HUB_TELEMETRY) && not defined(BAYANG_HUB_TELEMETRY) && not defined(CABELL_HUB_TELEMETRY) && not defined(RLINK_HUB_TELEMETRY) && not defined(AFHDS2A_HUB_TELEMETRY) && not defined(AFHDS2A_FW_TELEMETRY) && not defined(MULTI_TELEMETRY) && not defined(MULTI_STATUS) && not defined(HITEC_HUB_TELEMETRY) && not defined(HITEC_FW_TELEMETRY) && not defined(SCANNER_TELEMETRY) && not defined(FRSKY_RX_TELEMETRY) && not defined(AFHDS2A_RX_TELEMETRY) && not defined(BAYANG_RX_TELEMETRY) && not defined(DEVO_HUB_TELEMETRY) && not defined(PROPEL_HUB_TELEMETRY) && not defined(OMP_HUB_TELEMETRY) && not defined(WFLY2_HUB_TELEMETRY)
#undef TELEMETRY #undef TELEMETRY
#undef INVERT_TELEMETRY #undef INVERT_TELEMETRY
#undef MULTI_TELEMETRY #undef MULTI_TELEMETRY

View File

@ -13,24 +13,24 @@
along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>. along with Multiprotocol. If not, see <http://www.gnu.org/licenses/>.
*/ */
#if defined(WFLYRF_A7105_INO) #if defined(WFLY2_A7105_INO)
#include "iface_a7105.h" #include "iface_a7105.h"
//#define WFLYRF_FORCE_ID //#define WFLY2_FORCE_ID
//WFLYRF constants & variables //WFLY2 constants & variables
#define WFLYRF_BIND_COUNT 1000 #define WFLY2_BIND_COUNT 1000
#define WFLYRF_PACKET_SIZE 32 #define WFLY2_PACKET_SIZE 32
enum{ enum{
WFLYRF_BIND, WFLY2_BIND,
WFLYRF_DATA, WFLY2_DATA,
WFLYRF_PLL_TX, WFLY2_PLL_TX,
WFLYRF_RX, WFLY2_RX,
}; };
static void __attribute__((unused)) WFLYRF_send_bind_packet() static void __attribute__((unused)) WFLY2_send_bind_packet()
{ {
//Header //Header
packet[0] = 0x0F; // Bind packet packet[0] = 0x0F; // Bind packet
@ -56,16 +56,16 @@ static void __attribute__((unused)) WFLYRF_send_bind_packet()
//Debug //Debug
#if 0 #if 0
debug("ch=%02X P=",rf_ch_num); debug("ch=%02X P=",rf_ch_num);
for(uint8_t i=0; i<WFLYRF_PACKET_SIZE; i++) for(uint8_t i=0; i<WFLY2_PACKET_SIZE; i++)
debug("%02X ", packet[i]); debug("%02X ", packet[i]);
debugln(""); debugln("");
#endif #endif
//Send //Send
A7105_WriteData(WFLYRF_PACKET_SIZE, rf_ch_num); A7105_WriteData(WFLY2_PACKET_SIZE, rf_ch_num);
} }
static void __attribute__((unused)) WFLYRF_build_packet() static void __attribute__((unused)) WFLY2_build_packet()
{ {
static uint16_t pseudo=0; static uint16_t pseudo=0;
@ -124,14 +124,14 @@ static void __attribute__((unused)) WFLYRF_build_packet()
//Debug //Debug
#if 0 #if 0
debug("ch=%02X,%02X P=",rf_ch_num,(rf_ch_num<<1)+0x10); debug("ch=%02X,%02X P=",rf_ch_num,(rf_ch_num<<1)+0x10);
for(uint8_t i=0; i<WFLYRF_PACKET_SIZE; i++) for(uint8_t i=0; i<WFLY2_PACKET_SIZE; i++)
debug("%02X ", packet[i]); debug("%02X ", packet[i]);
debugln(""); debugln("");
#endif #endif
} }
#ifdef WFLYRF_HUB_TELEMETRY #ifdef WFLY2_HUB_TELEMETRY
static void __attribute__((unused)) WFLYRF_Send_Telemetry() static void __attribute__((unused)) WFLY2_Send_Telemetry()
{ {
//Incoming packet values //Incoming packet values
v_lipo1=packet[3]<<1; // RX_batt*10 in V v_lipo1=packet[3]<<1; // RX_batt*10 in V
@ -152,45 +152,45 @@ static void __attribute__((unused)) WFLYRF_build_packet()
} }
#endif #endif
#define WFLYRF_PACKET_PERIOD 3600 //3600 #define WFLY2_PACKET_PERIOD 3600 //3600
#define WFLYRF_BUFFER_TIME 1500 //1500 #define WFLY2_BUFFER_TIME 1500 //1500
#define WFLYRF_WRITE_TIME 800 //942 #define WFLY2_WRITE_TIME 800 //942
uint16_t ReadWFLYRF() uint16_t ReadWFLY2()
{ {
uint16_t start; uint16_t start;
#ifdef WFLYRF_HUB_TELEMETRY #ifdef WFLY2_HUB_TELEMETRY
uint8_t status; uint8_t status;
#endif #endif
#ifndef FORCE_WFLYRF_TUNING #ifndef FORCE_WFLY2_TUNING
A7105_AdjustLOBaseFreq(1); A7105_AdjustLOBaseFreq(1);
#endif #endif
switch(phase) switch(phase)
{ {
case WFLYRF_BIND: case WFLY2_BIND:
bind_counter--; bind_counter--;
if (bind_counter == 0) if (bind_counter == 0)
{ {
BIND_DONE; BIND_DONE;
A7105_WriteID(MProtocol_id); A7105_WriteID(MProtocol_id);
rf_ch_num = 0; rf_ch_num = 0;
phase++; // WFLYRF_DATA phase++; // WFLY2_DATA
} }
WFLYRF_send_bind_packet(); WFLY2_send_bind_packet();
return WFLYRF_PACKET_PERIOD; return WFLY2_PACKET_PERIOD;
case WFLYRF_DATA: case WFLY2_DATA:
#ifdef MULTI_SYNC #ifdef MULTI_SYNC
telemetry_set_input_sync(WFLYRF_PACKET_PERIOD); telemetry_set_input_sync(WFLY2_PACKET_PERIOD);
#endif #endif
//Build data packet //Build data packet
WFLYRF_build_packet(); WFLY2_build_packet();
//Fill the TX buffer without sending //Fill the TX buffer without sending
A7105_WriteData(WFLYRF_PACKET_SIZE,0); A7105_WriteData(WFLY2_PACKET_SIZE,0);
#ifdef WFLYRF_HUB_TELEMETRY #ifdef WFLY2_HUB_TELEMETRY
//LQI calculation //LQI calculation
packet_count++; packet_count++;
if(packet_count>=100) if(packet_count>=100)
@ -203,11 +203,11 @@ uint16_t ReadWFLYRF()
} }
#endif #endif
phase++; // WFLYRF_PLL_TX phase++; // WFLY2_PLL_TX
return WFLYRF_BUFFER_TIME; return WFLY2_BUFFER_TIME;
case WFLYRF_PLL_TX: case WFLY2_PLL_TX:
#ifdef WFLYRF_HUB_TELEMETRY #ifdef WFLY2_HUB_TELEMETRY
//Check RX status //Check RX status
status=A7105_ReadReg(A7105_00_MODE); status=A7105_ReadReg(A7105_00_MODE);
//debugln("S:%02X", status); //debugln("S:%02X", status);
@ -216,9 +216,9 @@ uint16_t ReadWFLYRF()
//PLL //PLL
A7105_Strobe(A7105_PLL); A7105_Strobe(A7105_PLL);
#ifdef WFLYRF_HUB_TELEMETRY #ifdef WFLY2_HUB_TELEMETRY
//Read incoming packet even if bad/not present to not change too much the TX timing, might want to reorg the code... //Read incoming packet even if bad/not present to not change too much the TX timing, might want to reorg the code...
A7105_ReadData(WFLYRF_PACKET_SIZE); A7105_ReadData(WFLY2_PACKET_SIZE);
//Read telemetry //Read telemetry
if((status & 0x21)==0) if((status & 0x21)==0)
@ -226,13 +226,13 @@ uint16_t ReadWFLYRF()
//Debug //Debug
#if 1 #if 1
debug("T:"); debug("T:");
for(uint8_t i=0; i<WFLYRF_PACKET_SIZE-20; i++) // Can't send the full telemetry at full speed for(uint8_t i=0; i<WFLY2_PACKET_SIZE-20; i++) // Can't send the full telemetry at full speed
debug(" %02X", packet[i]); debug(" %02X", packet[i]);
debugln(""); debugln("");
#endif #endif
//Packet match the ID ? //Packet match the ID ?
if(packet[0]==0 && packet[1]==rx_tx_addr[3] && packet[2]==(rx_tx_addr[2] & 0x03)) if(packet[0]==0 && packet[1]==rx_tx_addr[3] && packet[2]==(rx_tx_addr[2] & 0x03))
WFLYRF_Send_Telemetry(); // Packet looks good do send telem to the radio WFLY2_Send_Telemetry(); // Packet looks good do send telem to the radio
} }
#endif #endif
@ -244,10 +244,10 @@ uint16_t ReadWFLYRF()
A7105_SetTxRxMode(TX_EN); A7105_SetTxRxMode(TX_EN);
A7105_Strobe(A7105_TX); A7105_Strobe(A7105_TX);
phase++; // WFLYRF_RX phase++; // WFLY2_RX
return WFLYRF_WRITE_TIME; return WFLY2_WRITE_TIME;
case WFLYRF_RX: case WFLY2_RX:
//Wait for TX completion //Wait for TX completion
start=micros(); start=micros();
while ((uint16_t)((uint16_t)micros()-start) < 700) // Wait max 700µs while ((uint16_t)((uint16_t)micros()-start) < 700) // Wait max 700µs
@ -258,17 +258,17 @@ uint16_t ReadWFLYRF()
A7105_SetTxRxMode(RX_EN); A7105_SetTxRxMode(RX_EN);
A7105_Strobe(A7105_RX); A7105_Strobe(A7105_RX);
phase = WFLYRF_DATA; phase = WFLY2_DATA;
return WFLYRF_PACKET_PERIOD-WFLYRF_WRITE_TIME-WFLYRF_BUFFER_TIME; return WFLY2_PACKET_PERIOD-WFLY2_WRITE_TIME-WFLY2_BUFFER_TIME;
} }
return WFLYRF_PACKET_PERIOD; // never reached, please the compiler return WFLY2_PACKET_PERIOD; // never reached, please the compiler
} }
uint16_t initWFLYRF() uint16_t initWFLY2()
{ {
A7105_Init(); A7105_Init();
#ifdef WFLYRF_FORCE_ID #ifdef WFLY2_FORCE_ID
MProtocol_id = 0x50002313; //Richard MProtocol_id = 0x50002313; //Richard
//MProtocol_id = 0x50000223; //Pascal //MProtocol_id = 0x50000223; //Pascal
#endif #endif
@ -281,16 +281,16 @@ uint16_t initWFLYRF()
if(IS_BIND_IN_PROGRESS) if(IS_BIND_IN_PROGRESS)
{ {
bind_counter = WFLYRF_BIND_COUNT; bind_counter = WFLY2_BIND_COUNT;
A7105_WriteID(0x50FFFFFE); // Bind ID A7105_WriteID(0x50FFFFFE); // Bind ID
phase = WFLYRF_BIND; phase = WFLY2_BIND;
} }
else else
{ {
A7105_WriteID(MProtocol_id); A7105_WriteID(MProtocol_id);
phase = WFLYRF_DATA; phase = WFLY2_DATA;
} }
#ifdef WFLYRF_HUB_TELEMETRY #ifdef WFLY2_HUB_TELEMETRY
packet_count = 0; packet_count = 0;
telemetry_lost = 1; telemetry_lost = 1;
#endif #endif

View File

@ -122,7 +122,7 @@
//#define FORCE_HUBSAN_TUNING 0 //#define FORCE_HUBSAN_TUNING 0
//#define FORCE_KYOSHO_TUNING 0 //#define FORCE_KYOSHO_TUNING 0
//#define FORCE_PELIKAN_TUNING 0 //#define FORCE_PELIKAN_TUNING 0
//#define FORCE_WFLYRF_TUNING 0 //#define FORCE_WFLY2_TUNING 0
/** CYRF6936 Fine Frequency Tuning **/ /** CYRF6936 Fine Frequency Tuning **/
//This is required in rare cases where some CYRF6936 modules and/or RXs have an inaccurate crystal oscillator. //This is required in rare cases where some CYRF6936 modules and/or RXs have an inaccurate crystal oscillator.
@ -323,7 +323,7 @@
#define PROPEL_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX #define PROPEL_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define CABELL_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX #define CABELL_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define RLINK_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX #define RLINK_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define WFLYRF_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX #define WFLY2_HUB_TELEMETRY // Use FrSkyD Hub format to send telemetry to TX
#define HITEC_HUB_TELEMETRY // Use FrSkyD Hub format to send basic telemetry to the radios which can decode it like er9x, erskyTX and OpenTX #define HITEC_HUB_TELEMETRY // Use FrSkyD Hub format to send basic telemetry to the radios which can decode it like er9x, erskyTX and OpenTX
#define HITEC_FW_TELEMETRY // Forward received telemetry packets to be decoded by erskyTX and OpenTX #define HITEC_FW_TELEMETRY // Forward received telemetry packets to be decoded by erskyTX and OpenTX
#define SCANNER_TELEMETRY // Forward spectrum scanner data to TX #define SCANNER_TELEMETRY // Forward spectrum scanner data to TX
@ -754,7 +754,7 @@ const PPM_Parameters PPM_prot[14*NBR_BANKS]= {
V911S_E119 V911S_E119
PROTO_WFLY PROTO_WFLY
NONE NONE
PROTO_WFLYRF PROTO_WFLY2
NONE NONE
PROTO_WK2x01 PROTO_WK2x01
WK2801 WK2801