WFLY2: update channels throw, bind frequencies

This commit is contained in:
Pascal Langer 2020-12-14 18:56:12 +01:00
parent 484588ff6b
commit cfe80edcb6
2 changed files with 9 additions and 8 deletions

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 83 #define VERSION_PATCH_LEVEL 84
//****************** //******************
// Protocols // Protocols

View File

@ -45,10 +45,11 @@ static void __attribute__((unused)) WFLY2_send_bind_packet()
packet[5] = 0x01; packet[5] = 0x01;
//Freq //Freq
packet[6] = (hopping_frequency_no<<1)+0x0E; rf_ch_num = (hopping_frequency_no<<1)+0x08;
rf_ch_num = (hopping_frequency_no<<2)+0x2C; packet[6] = rf_ch_num;
hopping_frequency_no++; // not sure which frequencies are used since the dump only goes from 0x0E to 0x2C and stops... rf_ch_num = (rf_ch_num<<1)+0x10;
if(hopping_frequency_no > 0x1A) hopping_frequency_no=0x00; hopping_frequency_no++;
if(hopping_frequency_no > 0x17) hopping_frequency_no=0x00;
//Unknown //Unknown
memset(&packet[7],0x00,25); memset(&packet[7],0x00,25);
@ -107,13 +108,13 @@ static void __attribute__((unused)) WFLY2_build_packet()
packet[3] = rx_tx_addr[3]; packet[3] = rx_tx_addr[3];
packet[4] = rx_tx_addr[2] & 0x03; 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++) 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[5 + i*3] = temp&0xFF; // low byte
packet[7 + i*3] = (temp>>8)&0x0F; // high 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[6 + i*3] = temp&0xFF; // low byte
packet[7 + i*3] |= (temp>>4)&0xF0; // high byte packet[7 + i*3] |= (temp>>4)&0xF0; // high byte
} }