Bob Seque / mbed-dev

Fork of mbed-dev by mbed official

Revision:
48:b854a29e778d
Parent:
34:bb6061527455
--- a/targets/hal/TARGET_STM/TARGET_STM32F3/rtc_api.c	Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32F3/rtc_api.c	Tue Jan 12 09:45:14 2016 +0000
@@ -46,9 +46,6 @@
     rtc_inited = 1;
 
     RtcHandle.Instance = RTC;
-	
-    // Check if RTC is already initialized
-    if ((RTC->ISR & RTC_ISR_INITS) ==  RTC_ISR_INITS) return;
 
     // Enable Power clock
     __PWR_CLK_ENABLE();
@@ -83,6 +80,9 @@
         rtc_freq = LSI_VALUE;
     }
 
+    // Check if RTC is already initialized
+    if ((RTC->ISR & RTC_ISR_INITS) ==  RTC_ISR_INITS) return;
+
     // Enable RTC
     __HAL_RCC_RTC_ENABLE();