mirror of https://github.com/ARMmbed/mbed-os.git
Added LF clock starting code to SysInit.
parent
df6bd2f66c
commit
082fd409ce
|
@ -94,6 +94,16 @@ void SystemInit(void)
|
||||||
}
|
}
|
||||||
*(uint32_t volatile *)0x4006EC14 = 0xC0;
|
*(uint32_t volatile *)0x4006EC14 = 0xC0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Start the external 32khz crystal oscillator.
|
||||||
|
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
|
||||||
|
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
|
||||||
|
NRF_CLOCK->TASKS_LFCLKSTART = 1;
|
||||||
|
|
||||||
|
// Wait for the external oscillator to start up.
|
||||||
|
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -187,6 +187,16 @@ void SystemInit(void)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
SystemCoreClockUpdate();
|
SystemCoreClockUpdate();
|
||||||
|
|
||||||
|
// Start the external 32khz crystal oscillator.
|
||||||
|
NRF_CLOCK->LFCLKSRC = (CLOCK_LFCLKSRC_SRC_Xtal << CLOCK_LFCLKSRC_SRC_Pos);
|
||||||
|
NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
|
||||||
|
NRF_CLOCK->TASKS_LFCLKSTART = 1;
|
||||||
|
|
||||||
|
// Wait for the external oscillator to start up.
|
||||||
|
while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0) {
|
||||||
|
// Do nothing.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue