From db1da2d9cf32f8e55f36f89ac1e622dee00ab1ef Mon Sep 17 00:00:00 2001 From: Pascal Langer Date: Wed, 10 Jan 2018 11:25:07 +0100 Subject: [PATCH] Corona V1 tweaking --- Multiprotocol/Corona_cc2500.ino | 48 ++++++++++++++++++++------------- Multiprotocol/Multiprotocol.h | 2 +- 2 files changed, 30 insertions(+), 20 deletions(-) diff --git a/Multiprotocol/Corona_cc2500.ino b/Multiprotocol/Corona_cc2500.ino index 920bff5..dffef08 100644 --- a/Multiprotocol/Corona_cc2500.ino +++ b/Multiprotocol/Corona_cc2500.ino @@ -24,7 +24,7 @@ #define CORONA_BIND_CHANNEL_V1 0xD1 #define CORONA_BIND_CHANNEL_V2 0xB8 #define CORONA_COARSE 0x00 - +#define CORONA_CHANNEL_TIMING 1500 const PROGMEM uint8_t CORONA_init_values[] = { /* 00 */ 0x29, 0x2E, 0x06, 0x07, 0xD3, 0x91, 0xFF, 0x04, @@ -102,7 +102,7 @@ static void __attribute__((unused)) CORONA_init() } // 8 Channels with direct values from PPM -static void __attribute__((unused)) CORONA_send_packet() +static void __attribute__((unused)) CORONA_build_packet() { // Tune frequency if it has been changed if ( prev_option != option ) @@ -114,9 +114,18 @@ static void __attribute__((unused)) CORONA_send_packet() { if(state==0 || sub_protocol==COR_V1) { // Build standard packet + + // Set channel + CC2500_WriteReg(CC2500_0A_CHANNR, hopping_frequency[hopping_frequency_no]); + hopping_frequency_no++; + hopping_frequency_no%=CORONA_RF_NUM_CHANNELS; + // Update power + CC2500_SetPower(); + + // Build packet packet[0] = 0x10; // 17 bytes to follow - //Channels + // Channels memset(packet+9, 0x00, 4); for(uint8_t i=0; i<8; i++) { // Channel values are packed @@ -125,7 +134,7 @@ static void __attribute__((unused)) CORONA_send_packet() packet[9 + (i>>1)] |= (i&0x01)?(val>>4)&0xF0:(val>>8)&0x0F; } - //TX ID + // TX ID for(uint8_t i=0; i