File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed
hal/targets/cmsis/TARGET_NORDIC/TARGET_NRF5 Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,16 @@ void SystemInit(void)
94
94
}
95
95
* (uint32_t volatile * )0x4006EC14 = 0xC0 ;
96
96
}
97
+
98
+ // Start the external 32khz crystal oscillator.
99
+ NRF_CLOCK -> LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos );
100
+ NRF_CLOCK -> EVENTS_LFCLKSTARTED = 0 ;
101
+ NRF_CLOCK -> TASKS_LFCLKSTART = 1 ;
102
+
103
+ // Wait for the external oscillator to start up.
104
+ while (NRF_CLOCK -> EVENTS_LFCLKSTARTED == 0 ) {
105
+ // Do nothing.
106
+ }
97
107
}
98
108
99
109
Original file line number Diff line number Diff line change @@ -187,6 +187,16 @@ void SystemInit(void)
187
187
#endif
188
188
189
189
SystemCoreClockUpdate ();
190
+
191
+ // Start the external 32khz crystal oscillator.
192
+ NRF_CLOCK -> LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos );
193
+ NRF_CLOCK -> EVENTS_LFCLKSTARTED = 0 ;
194
+ NRF_CLOCK -> TASKS_LFCLKSTART = 1 ;
195
+
196
+ // Wait for the external oscillator to start up.
197
+ while (NRF_CLOCK -> EVENTS_LFCLKSTARTED == 0 ) {
198
+ // Do nothing.
199
+ }
190
200
}
191
201
192
202
You can’t perform that action at this time.
0 commit comments