File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NORDIC_CORDIO/TARGET_NRF5x Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change 4040
4141// Nordic Includes
4242#include " nrf.h"
43+ #include " nrf5x_lf_clk_helper.h"
4344
4445#include " NRFCordioHCIDriver.h"
4546#include " NRFCordioHCITransportDriver.h"
@@ -78,6 +79,14 @@ using namespace ble::vendor::cordio;
7879/* ! \brief Typical implementation revision number (LlRtCfg_t::implRev). */
7980#define LL_IMPL_REV 0x2303
8081
82+ #if MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_SYNTH
83+ #define NRF_LF_CLK_SRC CLOCK_LFCLKSRC_SRC_Synth
84+ #elif MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_XTAL
85+ #define NRF_LF_CLK_SRC CLOCK_LFCLKSRC_SRC_Xtal
86+ #elif MBED_CONF_NORDIC_NRF_LF_CLOCK_SRC == NRF_LF_SRC_RC
87+ #define NRF_LF_CLK_SRC CLOCK_LFCLKSRC_SRC_RC
88+ #endif
89+
8190// Note to implementer: this should be amended if the Cordio stack is updated
8291
8392// The Nordic-specific baseband configuration
@@ -283,7 +292,7 @@ void NRFCordioHCIDriver::do_initialize()
283292 }
284293
285294 /* configure low-frequency clock */
286- NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
295+ NRF_CLOCK->LFCLKSRC = (NRF_LF_CLK_SRC << CLOCK_LFCLKSRC_SRC_Pos);
287296 NRF_CLOCK->EVENTS_LFCLKSTARTED = 0 ;
288297 NRF_CLOCK->TASKS_LFCLKSTART = 1 ;
289298 while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0 )
You can’t perform that action at this time.
0 commit comments