From 00944ec6777e38cc1102b94c64885f1a77d90c1f Mon Sep 17 00:00:00 2001 From: George Oikonomou Date: Sun, 13 Nov 2016 18:09:56 +0000 Subject: [PATCH] Allow boards to append to overrides --- cpu/cc26xx-cc13xx/rf-core/ieee-mode.c | 7 +++++++ cpu/cc26xx-cc13xx/rf-core/rf-ble.c | 7 +++++++ cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c | 13 +++++++++++++ 3 files changed, 27 insertions(+) diff --git a/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c b/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c index 00ae3a989..67dc0f4ba 100644 --- a/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c +++ b/cpu/cc26xx-cc13xx/rf-core/ieee-mode.c @@ -259,6 +259,12 @@ volatile static uint8_t *rx_read_entry; static uint8_t tx_buf[TX_BUF_HDR_LEN + TX_BUF_PAYLOAD_LEN] CC_ALIGN(4); /*---------------------------------------------------------------------------*/ +#ifdef IEEE_MODE_CONF_BOARD_OVERRIDES +#define IEEE_MODE_BOARD_OVERRIDES IEEE_MODE_CONF_BOARD_OVERRIDES +#else +#define IEEE_MODE_BOARD_OVERRIDES +#endif +/*---------------------------------------------------------------------------*/ /* Overrides for IEEE 802.15.4, differential mode */ static uint32_t ieee_overrides[] = { 0x00354038, /* Synth: Set RTRIM (POTAILRESTRIM) to 5 */ @@ -273,6 +279,7 @@ static uint32_t ieee_overrides[] = { 0x002B50DC, /* Adjust AGC DC filter */ 0x05000243, /* Increase synth programming timeout */ 0x002082C3, /* Increase synth programming timeout */ + IEEE_MODE_BOARD_OVERRIDES 0xFFFFFFFF, /* End of override list */ }; /*---------------------------------------------------------------------------*/ diff --git a/cpu/cc26xx-cc13xx/rf-core/rf-ble.c b/cpu/cc26xx-cc13xx/rf-core/rf-ble.c index 75a11213a..f41011f5f 100644 --- a/cpu/cc26xx-cc13xx/rf-core/rf-ble.c +++ b/cpu/cc26xx-cc13xx/rf-core/rf-ble.c @@ -89,6 +89,12 @@ static struct ble_beacond_config { char adv_name[BLE_ADV_NAME_BUF_LEN]; } beacond_config = { .interval = BLE_ADV_INTERVAL }; /*---------------------------------------------------------------------------*/ +#ifdef RF_BLE_CONF_BOARD_OVERRIDES +#define RF_BLE_BOARD_OVERRIDES RF_BLE_CONF_BOARD_OVERRIDES +#else +#define RF_BLE_BOARD_OVERRIDES +#endif +/*---------------------------------------------------------------------------*/ /* BLE overrides */ static uint32_t ble_overrides[] = { 0x00364038, /* Synth: Set RTRIM (POTAILRESTRIM) to 6 */ @@ -97,6 +103,7 @@ static uint32_t ble_overrides[] = { 0xEAE00603, /* Synth: Set loop bandwidth after lock to 80 kHz (K3, LSB) */ 0x00010623, /* Synth: Set loop bandwidth after lock to 80 kHz (K3, MSB) */ 0x00456088, /* Adjust AGC reference level */ + RF_BLE_BOARD_OVERRIDES 0xFFFFFFFF, /* End of override list */ }; /*---------------------------------------------------------------------------*/ diff --git a/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c b/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c index ea875f286..90018071e 100644 --- a/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c +++ b/cpu/cc26xx-cc13xx/rf-core/smartrf-settings.c @@ -28,9 +28,19 @@ * OF THE POSSIBILITY OF SUCH DAMAGE. */ /*---------------------------------------------------------------------------*/ +#include "contiki-conf.h" + #include "driverlib/rf_mailbox.h" #include "driverlib/rf_common_cmd.h" #include "driverlib/rf_prop_cmd.h" + +#include +/*---------------------------------------------------------------------------*/ +#ifdef SMARTRF_SETTINGS_CONF_BOARD_OVERRIDES +#define SMARTRF_SETTINGS_BOARD_OVERRIDES SMARTRF_SETTINGS_CONF_BOARD_OVERRIDES +#else +#define SMARTRF_SETTINGS_BOARD_OVERRIDES +#endif /*---------------------------------------------------------------------------*/ /* Overrides for CMD_PROP_RADIO_DIV_SETUP */ static uint32_t overrides[] = @@ -107,6 +117,9 @@ static uint32_t overrides[] = (uint32_t)0x943, (uint32_t)0x963, + /* Board-specific overrides, if any */ + SMARTRF_SETTINGS_BOARD_OVERRIDES + (uint32_t)0xFFFFFFFF, }; /*---------------------------------------------------------------------------*/