fix: enable/disable RTC_BACKUP write access (#5911)
This commit is contained in:
@@ -67,8 +67,6 @@ void rtcInit()
|
|||||||
__HAL_RCC_PWR_CLK_ENABLE();
|
__HAL_RCC_PWR_CLK_ENABLE();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
HAL_PWR_EnableBkUpAccess();
|
|
||||||
|
|
||||||
// Enable LSE Oscillator
|
// Enable LSE Oscillator
|
||||||
RCC_OscInitTypeDef RCC_OscInitStruct;
|
RCC_OscInitTypeDef RCC_OscInitStruct;
|
||||||
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
|
||||||
@@ -101,6 +99,7 @@ void rtcInit()
|
|||||||
#if defined(RTC_BACKUP_RAM) && !defined(BOOT)
|
#if defined(RTC_BACKUP_RAM) && !defined(BOOT)
|
||||||
__HAL_RCC_BKPSRAM_CLK_ENABLE();
|
__HAL_RCC_BKPSRAM_CLK_ENABLE();
|
||||||
HAL_PWREx_EnableBkUpReg();
|
HAL_PWREx_EnableBkUpReg();
|
||||||
|
HAL_PWR_EnableBkUpAccess();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -109,5 +108,6 @@ void rtcDisableBackupReg()
|
|||||||
#if defined(RTC_BACKUP_RAM)
|
#if defined(RTC_BACKUP_RAM)
|
||||||
__HAL_RCC_BKPSRAM_CLK_DISABLE();
|
__HAL_RCC_BKPSRAM_CLK_DISABLE();
|
||||||
HAL_PWREx_DisableBkUpReg();
|
HAL_PWREx_DisableBkUpReg();
|
||||||
|
HAL_PWR_DisableBkUpAccess();
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user