diff --git a/Multiprotocol/FrSkyX_cc2500.ino b/Multiprotocol/FrSkyX_cc2500.ino index c79d8b1..37fe92f 100644 --- a/Multiprotocol/FrSkyX_cc2500.ino +++ b/Multiprotocol/FrSkyX_cc2500.ino @@ -132,7 +132,7 @@ static void __attribute__((unused)) FrSkyX_build_packet() failsafe_chan = 0; } else if (FS_flag & 0x10 && failsafe_chan < (sub_protocol & 0x01 ? 8-1:16-1)) { - FS_flag = 0x10 | ((FS_flag + 2) & 0x0F); //10, 12, 14, 16, 18, 1A, 1C, 1E - failsafe packet + FS_flag = 0x10 | ((FS_flag + 2) & 0x0F); //10, 12, 14, 16, 18, 1A, 1C, 1E - failsafe packet failsafe_chan ++; } else if (FS_flag & 0x10) { @@ -142,7 +142,7 @@ static void __attribute__((unused)) FrSkyX_build_packet() failsafe_count++; #endif - packet[0] = (sub_protocol & 0x02 ) ? 0x20 : 0x1D ; // LBT or FCC + packet[0] = (sub_protocol & 0x02 ) ? 0x20 : 0x1D ; // LBT or FCC packet[1] = rx_tx_addr[3]; packet[2] = rx_tx_addr[2]; packet[3] = 0x02; @@ -179,11 +179,11 @@ static void __attribute__((unused)) FrSkyX_build_packet() chan_1 = FrSkyX_scaleForPXX(startChan); startChan++; // - packet[9+i] = lowByte(chan_0); //3 bytes*4 + packet[9+i] = lowByte(chan_0); //3 bytes*4 packet[9+i+1]=(((chan_0>>8) & 0x0F)|(chan_1 << 4)); packet[9+i+2]=chan_1>>4; } - if(sub_protocol & 0x01 ) // in X8 mode send only 8ch every 9ms + if(sub_protocol & 0x01 ) //In X8 mode send only 8ch every 9ms chan_offset = 0 ; else chan_offset^=0x08; @@ -192,7 +192,7 @@ static void __attribute__((unused)) FrSkyX_build_packet() uint8_t limit = (sub_protocol & 2 ) ? 31 : 28 ; for (uint8_t i=22;i100) {//~1sec - FrSkyX_TX_Seq = 0x08 ; // Request init - FrSkyX_TX_IN_Seq = 0xFF ; // No sequence received yet + FrSkyX_TX_Seq = 0x08 ; //Request init + FrSkyX_TX_IN_Seq = 0xFF ; //No sequence received yet #ifdef SPORT_SEND for(uint8_t i=0;i<4;i++) - FrSkyX_TX_Frames[i].count=0; // discard frames in current output buffer + FrSkyX_TX_Frames[i].count=0; //Discard frames in current output buffer #endif packet_count=0; #if defined TELEMETRY telemetry_lost=1; #endif } - CC2500_Strobe(CC2500_SFRX); //flush the RXFIFO + CC2500_Strobe(CC2500_SFRX); //Flush the RXFIFO } FrSkyX_build_packet(); state = FRSKY_DATA1; diff --git a/Multiprotocol/Multiprotocol.h b/Multiprotocol/Multiprotocol.h index 20239a2..f51a3b0 100644 --- a/Multiprotocol/Multiprotocol.h +++ b/Multiprotocol/Multiprotocol.h @@ -19,7 +19,7 @@ #define VERSION_MAJOR 1 #define VERSION_MINOR 3 #define VERSION_REVISION 0 -#define VERSION_PATCH_LEVEL 27 +#define VERSION_PATCH_LEVEL 28 //****************** // Protocols diff --git a/Multiprotocol/Multiprotocol.ino b/Multiprotocol/Multiprotocol.ino index 5de4cc7..3299615 100644 --- a/Multiprotocol/Multiprotocol.ino +++ b/Multiprotocol/Multiprotocol.ino @@ -609,7 +609,7 @@ void loop() { //If at least 1ms is available update values count=0; Update_All(); - #if defined(STM32_BOARD) && defined(DEBUG_SERIAL) + #ifdef DEBUG_SERIAL if(TIMER2_BASE->SR & TIMER_SR_CC1IF ) debugln("Long update"); #endif @@ -2161,8 +2161,10 @@ static uint32_t random_id(uint16_t address, uint8_t create_new) else RX_MISSED_BUFF_on; // Notify that rx_buff is good } - else - debugln("RX frame too short"); + #ifdef DEBUG_SERIAL + else + debugln("RX frame too short"); + #endif discard_frame=true; #ifdef STM32_BOARD TIMER2_BASE->DIER &= ~TIMER_DIER_CC2IE; // Disable Timer2/Comp2 interrupt diff --git a/Multiprotocol/Telemetry.ino b/Multiprotocol/Telemetry.ino index 9f78485..cec1f52 100644 --- a/Multiprotocol/Telemetry.ino +++ b/Multiprotocol/Telemetry.ino @@ -80,7 +80,7 @@ static void multi_send_header(uint8_t type, uint8_t len) Serial_write(len); } -inline void telemetry_set_input_sync(uint16_t refreshRate) +static void telemetry_set_input_sync(uint16_t refreshRate) { #ifdef MULTI_SYNC #if defined(STM32_BOARD) && defined(DEBUG_PIN) diff --git a/Multiprotocol/_Config.h b/Multiprotocol/_Config.h index 2599670..0af782c 100644 --- a/Multiprotocol/_Config.h +++ b/Multiprotocol/_Config.h @@ -225,7 +225,7 @@ //FrSkyX specific setting //----------------------- //EU LBT setting: if commented the TX will not check if a channel is busy before transmitting. -//!!!Work in progress!!! it's currently known to cause telemerty issues. Enable only if you know what you are doing. +//!!! Work in progress !!! it's currently known to cause telemerty issues. Enable only if you know what you are doing. //#define FRSKYX_LBT //DSM specific settings @@ -283,7 +283,8 @@ //Send to OpenTX the current protocol and subprotocol names. Comment to disable. #define MULTI_NAMES //Sync OpenTX frames with the current protocol timing. This feature is only available on the STM32 module. Comment to disable. -#define MULTI_SYNC +//!!! Work in progress !!! Do not enable for internal module +//#define MULTI_SYNC //Comment a line to disable a specific protocol telemetry #define DSM_TELEMETRY // Forward received telemetry packet directly to TX to be decoded by er9x, erskyTX and OpenTX