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
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