Skip to content

Commit 35a49c4

Browse files
FRASTMfpistm
authored andcommitted
setAlarmTime : fix index in the table nb of days in a monthes
nb of days (endDay) is given by the daysInMonths table starting at 0 (january) Signed-off-by: Francois Ramu <[email protected]>
1 parent b4d61fc commit 35a49c4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/STM32LowPower.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ void STM32LowPower::setAlarmTime(uint32_t ms, STM32RTC &rtc)
295295
if (currentMonth == 2) {
296296
endDay = isLeapYear(currentYear) ? 29 : 28;
297297
} else {
298-
endDay = daysInMonths[currentMonth];
298+
endDay = daysInMonths[currentMonth - 1];
299299
}
300300

301301
uint8_t d = currentDay + daysToAdd;

0 commit comments

Comments
 (0)