From 6e814a95e2d7c4a66b13f3ae555b88cf60b26d0e Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Wed, 3 Apr 2024 14:53:55 +0200 Subject: [PATCH] fix(backup): update to support STM32C0xx BKPREG1 do not exist anymore, include the correct ll header. Signed-off-by: Frederic Pillon --- cores/arduino/stm32/backup.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cores/arduino/stm32/backup.h b/cores/arduino/stm32/backup.h index 6a2be641d5..0bb479d936 100644 --- a/cores/arduino/stm32/backup.h +++ b/cores/arduino/stm32/backup.h @@ -24,6 +24,7 @@ /* Includes ------------------------------------------------------------------*/ #include "stm32_def.h" #include "stm32yyxx_ll_rtc.h" +#include "stm32yyxx_ll_pwr.h" #ifdef __cplusplus extern "C" { @@ -128,7 +129,7 @@ static inline void setBackupRegister(uint32_t index, uint32_t value) #else LL_RTC_BKP_SetRegister(TAMP, index, value); #endif -#elif defined(BKPREG1) +#elif defined(PWR_BKP0R) LL_PWR_BKP_SetRegister(index, value); #else UNUSED(index); @@ -152,7 +153,7 @@ static inline uint32_t getBackupRegister(uint32_t index) #else return LL_RTC_BKP_GetRegister(TAMP, index); #endif -#elif defined(BKPREG1) +#elif defined(PWR_BKP0R) return LL_PWR_BKP_GetRegister(index); #else UNUSED(index);