mirror of https://github.com/ARMmbed/mbed-os.git
Nordic: refactor the way we select the LFCLKSRC
Rather than indefinitely adding platforms to a #define list that use the internal RC oscillator instead of an external crystal, let platforms define this and the 'core code' can be platform agnostic. Note, that this also allows people to use this symbol in libraries. There's one notable example in the BLE_API that can now be refactored to the same method, hopefully saving someone some unpleasant debugging when their platform doesn't work because of a missing platform dependent define in the high level API. Signed-off-by: Jonathan Austin <jonathan.austin@arm.com>pull/1267/head
parent
0ee410d831
commit
c285f2e1d3
|
@ -83,7 +83,8 @@ void SystemInit(void)
|
|||
|
||||
// Start the external 32khz crystal oscillator.
|
||||
|
||||
#if defined(TARGET_DELTA_DFCM_NNN40) || defined(TARGET_HRM1017) || defined(TARGET_NRF_LFCLK_RC)
|
||||
/* for Nordic devices without an external LF crystal */
|
||||
#if defined(TARGET_NRF_LFCLK_RC)
|
||||
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos);
|
||||
#else
|
||||
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
|
||||
|
|
Loading…
Reference in New Issue