From d1efbb1b1e8055597519c361b99a7eb44d943987 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Wed, 5 Sep 2018 18:39:34 +0200 Subject: [PATCH 1/2] nimble/ll: Fix build error when ADV EXT is disabled This fixes following build error: ble_ll_adv.c:2054: undefined reference to 'ble_ll_hci_adv_mode_ext' --- nimble/controller/src/ble_ll_hci.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/nimble/controller/src/ble_ll_hci.c b/nimble/controller/src/ble_ll_hci.c index 93fdd98d4..3d4ae900f 100644 --- a/nimble/controller/src/ble_ll_hci.c +++ b/nimble/controller/src/ble_ll_hci.c @@ -59,6 +59,12 @@ bool ble_ll_hci_adv_mode_ext(void) { return hci_adv_mode == ADV_MODE_EXT; } +#else +bool +ble_ll_hci_adv_mode_ext(void) +{ + return false; +} #endif /** From fac10275023a569f62cc7a4c6512d205e4600bb5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rymanowski?= Date: Wed, 5 Sep 2018 18:43:40 +0200 Subject: [PATCH 2/2] nimble/phy: Fix build error when only 1M is enabled This fixes following build error: [200~ble_phy.c:1831:5: error: implicit declaration of function 'ble_phy_apply_errata_102_106_107' --- nimble/drivers/nrf52/src/ble_phy.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/nimble/drivers/nrf52/src/ble_phy.c b/nimble/drivers/nrf52/src/ble_phy.c index aaeca9b94..ecbb4a83c 100644 --- a/nimble/drivers/nrf52/src/ble_phy.c +++ b/nimble/drivers/nrf52/src/ble_phy.c @@ -247,6 +247,19 @@ struct nrf_ccm_data struct nrf_ccm_data g_nrf_ccm_data; #endif +#ifdef NRF52 +static void +ble_phy_apply_errata_102_106_107(void) +{ + /* [102] RADIO: PAYLOAD/END events delayed or not triggered after ADDRESS + * [106] RADIO: Higher CRC error rates for some access addresses + * [107] RADIO: Immediate address match for access addresses containing MSBs 0x00 + */ + *(volatile uint32_t *)0x40001774 = ((*(volatile uint32_t *)0x40001774) & + 0xfffffffe) | 0x01000000; +} +#endif + #if (BLE_LL_BT5_PHY_SUPPORTED == 1) /* Packet start offset (in usecs). This is the preamble plus access address. @@ -312,19 +325,6 @@ ble_phy_apply_nrf52840_errata(uint8_t new_phy_mode) } #endif -#ifdef NRF52 -static void -ble_phy_apply_errata_102_106_107(void) -{ - /* [102] RADIO: PAYLOAD/END events delayed or not triggered after ADDRESS - * [106] RADIO: Higher CRC error rates for some access addresses - * [107] RADIO: Immediate address match for access addresses containing MSBs 0x00 - */ - *(volatile uint32_t *)0x40001774 = ((*(volatile uint32_t *)0x40001774) & - 0xfffffffe) | 0x01000000; -} -#endif - void ble_phy_mode_set(uint8_t new_phy_mode, uint8_t txtorx_phy_mode) {