Krzysztof Sitko / mbed-dev-STM32F031K6

Fork of mbed-dev by mbed official

Revision:
34:bb6061527455
Parent:
0:9b334a45a8ff
Child:
48:b854a29e778d
diff -r 7b49ef75af0b -r bb6061527455 targets/hal/TARGET_STM/TARGET_STM32F0/rtc_api.c
--- a/targets/hal/TARGET_STM/TARGET_STM32F0/rtc_api.c	Thu Dec 03 15:15:11 2015 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32F0/rtc_api.c	Mon Dec 07 08:00:11 2015 +0000
@@ -45,6 +45,9 @@
     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();