[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
adustm 2016-02-22 17:20:27 +01:00
parent 028465a9b8
commit fc84dd9234
1 changed files with 42 additions and 43 deletions

View File

@ -77,7 +77,8 @@ void rtc_init(void)
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
__HAL_RCC_RTC_ENABLE();
@ -92,8 +93,6 @@ void rtc_init(void)
if (HAL_RTC_Init(&RtcHandle) != HAL_OK) {
error("RTC error: RTC initialization failed.");
}
}
}
void rtc_free(void)