Skip to content

Commit

Permalink
fix: enable/disable RTC_BACKUP write access (#5911)
Browse files Browse the repository at this point in the history
  • Loading branch information
3djc authored and pfeerick committed Feb 17, 2025
1 parent 446b2b7 commit e5ab6fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions radio/src/targets/common/arm/stm32/rtc_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,6 @@ void rtcInit()
__HAL_RCC_PWR_CLK_ENABLE();
#endif

HAL_PWR_EnableBkUpAccess();

// Enable LSE Oscillator
RCC_OscInitTypeDef RCC_OscInitStruct;
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_LSE;
Expand Down Expand Up @@ -101,6 +99,7 @@ void rtcInit()
#if defined(RTC_BACKUP_RAM) && !defined(BOOT)
__HAL_RCC_BKPSRAM_CLK_ENABLE();
HAL_PWREx_EnableBkUpReg();
HAL_PWR_EnableBkUpAccess();
#endif
}

Expand All @@ -109,5 +108,6 @@ void rtcDisableBackupReg()
#if defined(RTC_BACKUP_RAM)
__HAL_RCC_BKPSRAM_CLK_DISABLE();
HAL_PWREx_DisableBkUpReg();
HAL_PWR_DisableBkUpAccess();
#endif
}

0 comments on commit e5ab6fe

Please sign in to comment.