Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 9 additions & 21 deletions libraries/RTC/src/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -666,27 +666,15 @@ bool RTClock::setAlarmCallback(rtc_cbk_t fnc, RTCTime &t, AlarmMatch &m) {
size_t cpy_size = (sizeof(at.time) <= sizeof(struct tm)) ? sizeof(at.time) : sizeof(struct tm);

memcpy(&at.time, &alrm, cpy_size);
if(m.isMatchingSecond()) {
at.sec_match = true;
}
else if(m.isMatchingMinute()) {
at.min_match = true;
}
else if(m.isMatchingHour() ) {
at.hour_match = true;
}
else if(m.isMatchingDay() ) {
at.mday_match = true;
}
else if(m.isMatchingMonth()) {
at.mon_match = true;
}
else if(m.isMatchingYear()) {
at.year_match = true;
}
else if(m.isMatchingDayOfWeek()) {
at.dayofweek_match = true;
}

at.sec_match = m.isMatchingSecond();
at.min_match = m.isMatchingMinute();
at.hour_match = m.isMatchingHour();
at.mday_match = m.isMatchingDay();
at.mon_match = m.isMatchingMonth();
at.year_match = m.isMatchingYear();
at.dayofweek_match = m.isMatchingDayOfWeek();

if(IRQManager::getInstance().addPeripheral(IRQ_RTC,&rtc_irq_cfg)) {
return setRtcAlarm(at);
}
Expand Down