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 )
3131 NVIC_ClearPendingIRQ (RTC1_IRQn );
3232 NVIC_EnableIRQ (RTC1_IRQn );
3333
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
3541 NRF_CLOCK -> TASKS_LFCLKSTART = 1UL ;
3642
3743 NRF_RTC1 -> PRESCALER = 0 ;
You can’t perform that action at this time.
0 commit comments