[NUCLEO_L152RE] Update rtc_free()

pull/331/head
bcostm 2014-05-27 09:24:28 +02:00
parent 20fee9fbff
commit a223580e6b
1 changed files with 10 additions and 1 deletions

View File

@ -90,7 +90,16 @@ void rtc_init(void) {
} }
void rtc_free(void) { void rtc_free(void) {
RCC_DeInit(); // Resets the RCC clock configuration to the default reset state // Reset RTC
PWR_RTCAccessCmd(ENABLE); // Enable access to Backup Domain
RTC_DeInit();
RCC_RTCResetCmd(ENABLE);
RCC_RTCResetCmd(DISABLE);
// Disable RTC, LSE and LSI clocks
RCC_RTCCLKCmd(DISABLE);
RCC_LSEConfig(RCC_LSE_OFF);
RCC_LSICmd(DISABLE);
rtc_inited = 0; rtc_inited = 0;
} }