File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,13 @@ void init( void )
31
31
NVIC_ClearPendingIRQ (RTC1_IRQn );
32
32
NVIC_EnableIRQ (RTC1_IRQn );
33
33
34
- NRF_CLOCK -> LFCLKSRC = (uint32_t )((CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos ) & CLOCK_LFCLKSRC_SRC_Msk );
34
+ #if defined(USE_LFXO )
35
+ NRF_CLOCK -> LFCLKSRC = (uint32_t )((CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos ) & CLOCK_LFCLKSRC_SRC_Msk );
36
+ #elif defined(USE_LFSYNT )
37
+ NRF_CLOCK -> LFCLKSRC = (uint32_t )((CLOCK_LFCLKSRC_SRC_Synth << CLOCK_LFCLKSRC_SRC_Pos ) & CLOCK_LFCLKSRC_SRC_Msk );
38
+ #else //USE_LFRC
39
+ NRF_CLOCK -> LFCLKSRC = (uint32_t )((CLOCK_LFCLKSRC_SRC_RC << CLOCK_LFCLKSRC_SRC_Pos ) & CLOCK_LFCLKSRC_SRC_Msk );
40
+ #endif
35
41
NRF_CLOCK -> TASKS_LFCLKSTART = 1UL ;
36
42
37
43
NRF_RTC1 -> PRESCALER = 0 ;
You can’t perform that action at this time.
0 commit comments