mirror of https://github.com/ARMmbed/mbed-os.git
[STM32F7 family] fix issue with RTC init
the logical test for RTC_ISR_INITS was wronlgy reported from other STMfamilies. MBED_16 test works with this modification.pull/1559/head
parent
028465a9b8
commit
fc84dd9234
|
@ -77,7 +77,8 @@ void rtc_init(void)
|
||||||
rtc_freq = LSI_VALUE;
|
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
|
// Check if RTC is already initialized
|
||||||
|
if ((RTC->ISR & RTC_ISR_INITS) == RTC_ISR_INITS) return;
|
||||||
|
|
||||||
// Enable RTC
|
// Enable RTC
|
||||||
__HAL_RCC_RTC_ENABLE();
|
__HAL_RCC_RTC_ENABLE();
|
||||||
|
@ -92,8 +93,6 @@ void rtc_init(void)
|
||||||
if (HAL_RTC_Init(&RtcHandle) != HAL_OK) {
|
if (HAL_RTC_Init(&RtcHandle) != HAL_OK) {
|
||||||
error("RTC error: RTC initialization failed.");
|
error("RTC error: RTC initialization failed.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rtc_free(void)
|
void rtc_free(void)
|
||||||
|
|
Loading…
Reference in New Issue