FrSky D/X telemetry update

This commit is contained in:
pascallanger 2017-01-31 08:46:50 +01:00
parent 17bb2f11e4
commit e85208110f
2 changed files with 6 additions and 4 deletions

View File

@ -158,6 +158,7 @@ uint16_t ReadFrSky_2way()
#if defined(TELEMETRY)
if(pkt[len-1] & 0x80)
{//with valid crc
packet_count=0;
frsky_check_telemetry(pkt,len); //check if valid telemetry packets and buffer them.
}
#endif

View File

@ -221,7 +221,7 @@ uint16_t ReadFrSkyX()
len = CC2500_ReadReg(CC2500_3B_RXBYTES | CC2500_READ_BURST) & 0x7F;
if (len && (len<=(0x0E + 3))) //Telemetry frame is 17
{
counter=0;
packet_count=0;
CC2500_ReadData(pkt, len);
#if defined TELEMETRY
frsky_check_telemetry(pkt,len); //check if valid telemetry packets
@ -231,13 +231,13 @@ uint16_t ReadFrSkyX()
}
else
{
counter++;
packet_count++;
// restart sequence on missed packet - might need count or timeout instead of one missed
if(counter>100)
if(packet_count>100)
{//~1sec
seq_last_sent = 0;
seq_last_rcvd = 8;
counter=0;
packet_count=0;
#if defined TELEMETRY
telemetry_lost=1;
#endif
@ -254,6 +254,7 @@ uint16_t initFrSkyX()
{
set_rx_tx_addr(MProtocol_id_master);
Frsky_init_hop();
packet_count=0;
while(!chanskip)
chanskip=random(0xfefefefe)%47;