[LPC4337] Remove init variable for RTC

- Remove static variable for initialization check
- Add enabled flag check for RTC control register
pull/815/head
Toyomasa Watarai 2014-12-25 09:41:33 +09:00
parent 44c66b1062
commit 7b62e7d5d6
1 changed files with 2 additions and 4 deletions

View File

@ -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));