Skip to content

Commit c31b789

Browse files
committed
drivers: rtc: rpi_pico: fix tm_mon and tm_mday offsets
tm_mon is 0-11 and pico hw is 1-12 tm_mday is 1-31 and so is pico Signed-off-by: Benjamin Cabé <[email protected]>
1 parent ec96009 commit c31b789

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/rtc/rtc_rpi_pico.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@ static int rtc_rpi_pico_alarm_set_time(const struct device *dev, uint16_t id, ui
212212
if (mask & RTC_ALARM_TIME_MASK_MONTH) {
213213
hw_set_bits(&rtc_hw->irq_setup_0,
214214
RTC_IRQ_SETUP_0_MONTH_ENA_BITS |
215-
(alarm->tm_mon << RTC_IRQ_SETUP_0_MONTH_LSB));
215+
((alarm->tm_mon + 1) << RTC_IRQ_SETUP_0_MONTH_LSB));
216216
}
217217
if (mask & RTC_ALARM_TIME_MASK_MONTHDAY) {
218218
hw_set_bits(&rtc_hw->irq_setup_0,
219219
RTC_IRQ_SETUP_0_DAY_ENA_BITS |
220-
((alarm->tm_mday + 1) << RTC_IRQ_SETUP_0_DAY_LSB));
220+
(alarm->tm_mday << RTC_IRQ_SETUP_0_DAY_LSB));
221221
}
222222
if (mask & RTC_ALARM_TIME_MASK_WEEKDAY) {
223223
hw_set_bits(&rtc_hw->irq_setup_1,

0 commit comments

Comments
 (0)