mbed library sources. Supersedes mbed-src.

Fork of mbed by teralytic

Revision:
48:b854a29e778d
Parent:
34:bb6061527455
Child:
71:a5b1c83f05dc
--- a/targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c	Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32L4/rtc_api.c	Tue Jan 12 09:45:14 2016 +0000
@@ -48,9 +48,6 @@
 
     RtcHandle.Instance = RTC;
 
-    // Check if RTC is already initialized
-    if ((RTC->ISR & RTC_ISR_INITS) ==  RTC_ISR_INITS) return;
-
     // Enable Power clock
     __HAL_RCC_PWR_CLK_ENABLE();
 
@@ -91,6 +88,9 @@
         rtc_freq = 40000;
     }
 
+    // Check if RTC is already initialized
+    if ((RTC->ISR & RTC_ISR_INITS) ==  RTC_ISR_INITS) return;
+
     // Enable RTC
     __HAL_RCC_RTC_ENABLE();