Skip to content

Commit c481302

Browse files
committed
bug fix in setAlarmEpoch.
The function setAlarmDate was not called correctly in the function setAlarmEpoch. It was called with the arguments (year, month, day) instead of (day, month, year). This following masks work properly now: * MATCH_DHHMMSS * MATCH_MMDDHHMMSS * MATCH_YYMMDDHHMMSS
1 parent b603153 commit c481302

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/RTCZero.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ void RTCZero::setAlarmEpoch(uint32_t ts)
392392
time_t t = ts;
393393
struct tm* tmp = gmtime(&t);
394394

395-
setAlarmDate(tmp->tm_year - EPOCH_TIME_YEAR_OFF, tmp->tm_mon + 1, tmp->tm_mday);
395+
setAlarmDate(tmp->tm_mday, tmp->tm_mon + 1, tmp->tm_year - EPOCH_TIME_YEAR_OFF);
396396
setAlarmTime(tmp->tm_hour, tmp->tm_min, tmp->tm_sec);
397397
}
398398
}

0 commit comments

Comments
 (0)