FrSky D16 LBT v1.x & 2.1: adjust thresholds to match ETSI requirements

This commit is contained in:
Pascal Langer 2020-05-02 18:20:47 +02:00
parent 2be757e609
commit 957d623b4b
3 changed files with 14 additions and 3 deletions

View File

@ -150,6 +150,11 @@ void CC2500_SetPower()
#else
power=CC2500_HIGH_POWER;
#endif
if(IS_LBT_POWER_on)
{
power=CC2500_LBT_POWER;
LBT_POWER_off; // Only accept once
}
if(IS_RANGE_FLAG_on)
power=CC2500_RANGE_POWER;
if(prev_power != power)

View File

@ -302,10 +302,10 @@ uint16_t ReadFrSkyX()
uint8_t rssi_level=convert_channel_8b(CH16)>>1; //CH16 0..127
if ( rssi > rssi_level && rssi < 128) //test rssi level dynamically
#else
if ( rssi > 72 && rssi < 128) //LBT and RSSI between -36 and -8.5 dBm
if ( rssi > 14 && rssi < 128) // if RSSI above -65dBm (12=-70) => ETSI requirement
#endif
{
POWER_FLAG_off; // Reduce to low power before transmitting
LBT_POWER_on; // Reduce to low power before transmitting
debugln("Busy %d %d",hopping_frequency_no,rssi);
}
}

View File

@ -19,7 +19,7 @@
#define VERSION_MAJOR 1
#define VERSION_MINOR 3
#define VERSION_REVISION 0
#define VERSION_PATCH_LEVEL 93
#define VERSION_PATCH_LEVEL 94
//******************
// Protocols
@ -487,6 +487,11 @@ enum MultiPacketTypes
#define DISABLE_TELEM_on protocol_flags3 |= _BV(3)
#define IS_DISABLE_TELEM_on ( ( protocol_flags3 & _BV(3) ) !=0 )
#define IS_DISABLE_TELEM_off ( ( protocol_flags3 & _BV(3) ) ==0 )
//LBT power
#define LBT_POWER_off protocol_flags3 &= ~_BV(7)
#define LBT_POWER_on protocol_flags3 |= _BV(7)
#define IS_LBT_POWER_on ( ( protocol_flags3 & _BV(7) ) !=0 )
#define IS_LBT_POWER_off ( ( protocol_flags3 & _BV(7) ) ==0 )
// Failsafe
@ -611,6 +616,7 @@ enum CC2500_POWER
CC2500_POWER_17 = 0xFF // +1dbm
};
#define CC2500_HIGH_POWER CC2500_POWER_17
#define CC2500_LBT_POWER CC2500_POWER_14
#define CC2500_LOW_POWER CC2500_POWER_13
#define CC2500_RANGE_POWER CC2500_POWER_1
#define CC2500_BIND_POWER CC2500_POWER_1