Skip to content

Commit ead6df5

Browse files
committed
fix: restore default alarm values if valid
Signed-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent 74e2b17 commit ead6df5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/STM32RTC.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ void STM32RTC::begin(bool resetTime, Hour_Format format)
7373

7474
syncTime();
7575
syncDate();
76-
76+
syncAlarmTime();
7777
if (!IS_RTC_DATE(_alarmDay)) {
7878
// Use current time to init alarm members,
7979
// specially in case _alarmDay is 0 (reset value) which is an invalid value
@@ -85,6 +85,7 @@ void STM32RTC::begin(bool resetTime, Hour_Format format)
8585
_alarmPeriod = _hoursPeriod;
8686
}
8787
#ifdef RTC_ALARM_B
88+
syncAlarmTime(ALARM_B);
8889
if (!IS_RTC_DATE(_alarmBDay)) {
8990
// Use current time to init alarm members,
9091
// specially in case _alarmDay is 0 (reset value) which is an invalid value

0 commit comments

Comments
 (0)