stm32duino / STM32RTC

Arduino RTC library for STM32.
135 stars 49 forks source link

fix: ability to set alarm after reset #77

Closed ABOSTM closed 2 years ago

ABOSTM commented 2 years ago

fix: ability to set alarm after reset

Be sure to set default value for alarmday, and thus avoid IS_RTC_DATE(day) being false when is not usd in alarm setting

Take into account Reset usecase (being able to set new alarma after a reset)

Factorize change of RTC clock source in the RTC_begin() function which imply a reset of BackupDomain. Save configuration before this BackupDomain reset, and restore after.

Tested with sketches from RTC and LowPower libraries, on both Nucleo F103RB and Nucleo L476RG

fixes stm32duino/STM32LowPower#82

tshcherban commented 2 years ago

You meant that #82?

ABOSTM commented 2 years ago

You meant that #82?

yes