Small tweaks

This commit is contained in:
pascallanger 2019-11-01 15:11:31 +01:00
parent 9b499ab7d1
commit 5cf2bf2cf5
5 changed files with 24 additions and 20 deletions

View File

@ -183,7 +183,7 @@ static void __attribute__((unused)) FrSkyX_build_packet()
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;
@ -201,7 +201,7 @@ static void __attribute__((unused)) FrSkyX_build_packet()
//debugln("Init");
FrSkyX_TX_Seq = 0 ;
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
}
else if (FrSkyX_TX_IN_Seq & 0x04)
{//Retransmit the requested packet
@ -316,6 +316,7 @@ uint16_t ReadFrSkyX()
else
{
packet_count++;
//debugln("M %d",packet_count);
// restart sequence on missed packet - might need count or timeout instead of one missed
if(packet_count>100)
{//~1sec
@ -323,14 +324,14 @@ uint16_t ReadFrSkyX()
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;

View File

@ -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

View File

@ -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
}
#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

View File

@ -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)

View File

@ -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