Merge pull request #1559 from adustm/b_stm32f7_rtcfix

[STM32F7 family] fix issue with RTC init
pull/1567/head
Martin Kojtal 2016-02-25 09:09:37 +00:00
commit 5b9a91ed96
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)