Allow band-specific RSSI offset override

This commit is contained in:
George Oikonomou 2016-12-10 21:21:02 +00:00
parent 47bda9b6be
commit 7603e104c4

View file

@ -49,10 +49,18 @@
#define SMARTRF_SETTINGS_BAND_OVERRIDES #define SMARTRF_SETTINGS_BAND_OVERRIDES
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#ifdef SMARTRF_SETTINGS_CONF_OVERRIDE_RSSI_OFFSET /* RSSI offset configuration for the 431-527MHz band */
#define SMARTRF_SETTINGS_OVERRIDE_RSSI_OFFSET SMARTRF_SETTINGS_CONF_OVERRIDE_RSSI_OFFSET #ifdef SMARTRF_SETTINGS_CONF_RSSI_OFFSET_431_527
#define SMARTRF_SETTINGS_RSSI_OFFSET_431_527 SMARTRF_SETTINGS_CONF_RSSI_OFFSET_431_527
#else #else
#define SMARTRF_SETTINGS_OVERRIDE_RSSI_OFFSET 0x00FB88A3 #define SMARTRF_SETTINGS_RSSI_OFFSET_431_527 0x000288A3
#endif
/*---------------------------------------------------------------------------*/
/* RSSI offset configuration for the 779-930MHz band */
#ifdef SMARTRF_SETTINGS_CONF_RSSI_OFFSET_779_930
#define SMARTRF_SETTINGS_RSSI_OFFSET_779_930 SMARTRF_SETTINGS_CONF_RSSI_OFFSET_779_930
#else
#define SMARTRF_SETTINGS_RSSI_OFFSET_779_930 0x00FB88A3
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
#ifdef SMARTRF_SETTINGS_CONF_OVERRIDE_TRIM_OFFSET #ifdef SMARTRF_SETTINGS_CONF_OVERRIDE_TRIM_OFFSET
@ -61,6 +69,13 @@
#define SMARTRF_SETTINGS_OVERRIDE_TRIM_OFFSET 0x00038883 #define SMARTRF_SETTINGS_OVERRIDE_TRIM_OFFSET 0x00038883
#endif #endif
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
/* Select RSSI offset value based on the frequency band */
#if DOT_15_4G_FREQUENCY_BAND_ID==DOT_15_4G_FREQUENCY_BAND_470
#define RSSI_OFFSET SMARTRF_SETTINGS_RSSI_OFFSET_431_527
#else
#define RSSI_OFFSET SMARTRF_SETTINGS_RSSI_OFFSET_779_930
#endif
/*---------------------------------------------------------------------------*/
/* Overrides for CMD_PROP_RADIO_DIV_SETUP */ /* Overrides for CMD_PROP_RADIO_DIV_SETUP */
static uint32_t overrides[] = static uint32_t overrides[] =
{ {
@ -125,7 +140,7 @@ static uint32_t overrides[] =
* Rx: Set RSSI offset to adjust reported RSSI * Rx: Set RSSI offset to adjust reported RSSI
* The board can override this * The board can override this
*/ */
(uint32_t)SMARTRF_SETTINGS_OVERRIDE_RSSI_OFFSET, (uint32_t)RSSI_OFFSET,
/* /*
* TX power override * TX power override