mirror of https://github.com/ARMmbed/mbed-os.git
[LPC4337] Remove init variable for RTC
- Remove static variable for initialization check - Add enabled flag check for RTC control registerpull/815/head
parent
44c66b1062
commit
7b62e7d5d6
|
@ -36,12 +36,10 @@
|
|||
* without impacting if it is the case
|
||||
*/
|
||||
|
||||
static int rtc_inited = 0;
|
||||
|
||||
void rtc_init(void) {
|
||||
if (rtc_inited)
|
||||
// Return, if already enabled
|
||||
if (LPC_RTC->CCR & 1)
|
||||
return;
|
||||
rtc_inited = 1;
|
||||
|
||||
// Enable 1kHz output of 32kHz oscillator
|
||||
LPC_CREG->CREG0 &= ~((1 << 3) | (1 << 2));
|
||||
|
|
Loading…
Reference in New Issue