Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of mbed-dev by
Revision 48:b854a29e778d, committed 2016-01-12
- Comitter:
- mbed_official
- Date:
- Tue Jan 12 09:45:14 2016 +0000
- Parent:
- 47:e32b5dd8af6d
- Child:
- 49:57ac6e3cdfd3
- Commit message:
- Synchronized with git revision 26e3c619834959fb5e3b3094c197b9e1cf65b31d
Full URL: https://github.com/mbedmicro/mbed/commit/26e3c619834959fb5e3b3094c197b9e1cf65b31d/
Need to keep PWR_CLK_ENABLE and LSE LSI oscillator configuration.
Just skip the HAL_RTC_Init in case INITS flag is already set.
Changed in this revision
--- a/targets/hal/TARGET_STM/TARGET_STM32F0/rtc_api.c Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32F0/rtc_api.c Tue Jan 12 09:45:14 2016 +0000
@@ -45,9 +45,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();
@@ -82,6 +79,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();
--- 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();
--- a/targets/hal/TARGET_STM/TARGET_STM32F4/rtc_api.c Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32F4/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();
@@ -85,6 +82,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();
--- a/targets/hal/TARGET_STM/TARGET_STM32F7/rtc_api.c Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32F7/rtc_api.c Tue Jan 12 09:45:14 2016 +0000
@@ -40,8 +40,6 @@
RCC_OscInitTypeDef RCC_OscInitStruct;
uint32_t rtc_freq = 0;
- if((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) { // RTC initialization and status register (RTC_ISR), cold start (with no backup domain power) RTC reset value
-
RtcHandle.Instance = RTC;
// Enable Power clock
@@ -79,6 +77,8 @@
rtc_freq = LSI_VALUE;
}
+ if((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) { // RTC initialization and status register (RTC_ISR), cold start (with no backup domain power) RTC reset value
+
// Enable RTC
__HAL_RCC_RTC_ENABLE();
--- a/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/rtc_api.c Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_DISCO_L053C8/rtc_api.c Tue Jan 12 09:45:14 2016 +0000
@@ -54,9 +54,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();
@@ -97,6 +94,9 @@
}
#endif
+ // Check if RTC is already initialized
+ if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;
+
// Enable RTC
__HAL_RCC_RTC_ENABLE();
--- a/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/rtc_api.c Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L053R8/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();
@@ -85,6 +82,9 @@
rtc_freq = 32000;
}
+ // Check if RTC is already initialized
+ if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;
+
// Enable RTC
__HAL_RCC_RTC_ENABLE();
--- a/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/rtc_api.c Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32L0/TARGET_NUCLEO_L073RZ/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();
@@ -85,6 +82,9 @@
rtc_freq = 32000;
}
+ // Check if RTC is already initialized
+ if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;
+
// Enable RTC
__HAL_RCC_RTC_ENABLE();
--- a/targets/hal/TARGET_STM/TARGET_STM32L1/rtc_api.c Mon Jan 11 17:00:10 2016 +0000
+++ b/targets/hal/TARGET_STM/TARGET_STM32L1/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();
@@ -85,6 +82,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();
--- 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();
