From 85ee4a95ec7bbbf1978abd0ca76187796e377664 Mon Sep 17 00:00:00 2001 From: pascallanger Date: Tue, 24 Jan 2017 16:55:52 +0100 Subject: [PATCH] Simplification of chanskip usage --- Multiprotocol/FrSkyX_cc2500.ino | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Multiprotocol/FrSkyX_cc2500.ino b/Multiprotocol/FrSkyX_cc2500.ino index b88143d..475c714 100644 --- a/Multiprotocol/FrSkyX_cc2500.ino +++ b/Multiprotocol/FrSkyX_cc2500.ino @@ -21,8 +21,6 @@ #include "iface_cc2500.h" uint8_t chanskip; -uint8_t counter_rst; -uint8_t ctr; uint8_t seq_last_sent; uint8_t seq_last_rcvd; @@ -155,8 +153,8 @@ static void __attribute__((unused)) frskyX_data_frame() packet[2] = rx_tx_addr[2]; packet[3] = 0x02; // - packet[4] = (ctr<<6)+hopping_frequency_no; - packet[5] = counter_rst; + packet[4] = (chanskip<<6)|hopping_frequency_no; + packet[5] = chanskip>>2; packet[6] = RX_num; //packet[7] = FLAGS 00 - standard packet //10, 12, 14, 16, 18, 1A, 1C, 1E - failsafe packet @@ -288,9 +286,6 @@ uint16_t initFrSkyX() Frsky_init_hop(); while(!chanskip) chanskip=random(0xfefefefe)%47; - while((chanskip-ctr)%4) - ctr=(ctr+1)%4; - counter_rst=(chanskip-ctr)>>2; //for test*************** //rx_tx_addr[3]=0xB3;