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
Jonathan Austin 2015-07-21 13:56:24 +01:00
parent 0ee410d831
commit c285f2e1d3
1 changed files with 2 additions and 1 deletions

View File

@ -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);