From cfe80edcb66b32db814cc11eeb99e0dc3e239695 Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Mon, 14 Dec 2020 18:56:12 +0100 Subject: [PATCH] WFLY2: update channels throw, bind frequencies --- Multiprotocol/Multiprotocol.h | 2 +- Multiprotocol/WFLY2_a7105.ino | 15 ++++++++------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 244e19f..4cfa5de 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 1 -#define VERSION_PATCH_LEVEL 83 +#define VERSION_PATCH_LEVEL 84 //****************** // Protocols diff --git a/Multiprotocol/WFLY2_a7105.ino b/Multiprotocol/WFLY2_a7105.ino index fa0211a..b58b18f 100644 --- a/Multiprotocol/WFLY2_a7105.ino +++ b/Multiprotocol/WFLY2_a7105.ino @@ -45,10 +45,11 @@ static void __attribute__((unused)) WFLY2_send_bind_packet() packet[5] = 0x01; //Freq - packet[6] = (hopping_frequency_no<<1)+0x0E; - rf_ch_num = (hopping_frequency_no<<2)+0x2C; - hopping_frequency_no++; // not sure which frequencies are used since the dump only goes from 0x0E to 0x2C and stops... - if(hopping_frequency_no > 0x1A) hopping_frequency_no=0x00; + rf_ch_num = (hopping_frequency_no<<1)+0x08; + packet[6] = rf_ch_num; + rf_ch_num = (rf_ch_num<<1)+0x10; + hopping_frequency_no++; + if(hopping_frequency_no > 0x17) hopping_frequency_no=0x00; //Unknown memset(&packet[7],0x00,25); @@ -107,13 +108,13 @@ static void __attribute__((unused)) WFLY2_build_packet() packet[3] = rx_tx_addr[3]; packet[4] = rx_tx_addr[2] & 0x03; - //10 channels + //10 channels -100%=0x2C1...0%=0x800...+100%=0xD3F for(uint8_t i = 0; i < 5; i++) { - uint16_t temp=convert_channel_16b_nolimit(i*2 , 0x0000, 0x0FFF); // need to check channels min/max... + uint16_t temp=convert_channel_16b_nolimit(i*2 , 0x2C1, 0xD3F); packet[5 + i*3] = temp&0xFF; // low byte packet[7 + i*3] = (temp>>8)&0x0F; // high byte - temp=convert_channel_16b_nolimit(i*2+1, 0x0000, 0x0FFF); // need to check channels min/max... + temp=convert_channel_16b_nolimit(i*2+1, 0x2C1, 0xD3F); packet[6 + i*3] = temp&0xFF; // low byte packet[7 + i*3] |= (temp>>4)&0xF0; // high byte }