Skip to content

Commit 7ff72ee

Browse files
jakubtopicnashif
authored andcommitted
drivers: rtc: rv3028: fix minutes alarm
Use correct value for Minutes Alarm register when disabling this alarm. Signed-off-by: Jakub Topic <[email protected]>
1 parent 0b3c67c commit 7ff72ee

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/rtc/rtc_rv3028.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ static int rv3028_set_time(const struct device *dev, const struct rtc_time *time
477477
date[0] = bin2bcd(timeptr->tm_sec) & RV3028_SECONDS_MASK;
478478
date[1] = bin2bcd(timeptr->tm_min) & RV3028_MINUTES_MASK;
479479
date[2] = bin2bcd(timeptr->tm_hour) & RV3028_HOURS_24H_MASK;
480-
date[3] = bin2bcd(timeptr->tm_wday) & RV3028_WEEKDAY_MASK;
480+
date[3] = timeptr->tm_wday & RV3028_WEEKDAY_MASK;
481481
date[4] = bin2bcd(timeptr->tm_mday) & RV3028_DATE_MASK;
482482
date[5] = bin2bcd(timeptr->tm_mon + RV3028_MONTH_OFFSET) & RV3028_MONTH_MASK;
483483
date[6] = bin2bcd(timeptr->tm_year - RV3028_YEAR_OFFSET) & RV3028_YEAR_MASK;
@@ -525,7 +525,7 @@ static int rv3028_get_time(const struct device *dev, struct rtc_time *timeptr)
525525
timeptr->tm_sec = bcd2bin(date[0] & RV3028_SECONDS_MASK);
526526
timeptr->tm_min = bcd2bin(date[1] & RV3028_MINUTES_MASK);
527527
timeptr->tm_hour = bcd2bin(date[2] & RV3028_HOURS_24H_MASK);
528-
timeptr->tm_wday = bcd2bin(date[3] & RV3028_WEEKDAY_MASK);
528+
timeptr->tm_wday = date[3] & RV3028_WEEKDAY_MASK;
529529
timeptr->tm_mday = bcd2bin(date[4] & RV3028_DATE_MASK);
530530
timeptr->tm_mon = bcd2bin(date[5] & RV3028_MONTH_MASK) - RV3028_MONTH_OFFSET;
531531
timeptr->tm_year = bcd2bin(date[6] & RV3028_YEAR_MASK) + RV3028_YEAR_OFFSET;
@@ -579,7 +579,7 @@ static int rv3028_alarm_set_time(const struct device *dev, uint16_t id, uint16_t
579579
if (mask & RTC_ALARM_TIME_MASK_MINUTE) {
580580
regs[0] = bin2bcd(timeptr->tm_min) & RV3028_ALARM_MINUTES_MASK;
581581
} else {
582-
regs[0] = RTC_ALARM_TIME_MASK_MINUTE;
582+
regs[0] = RV3028_ALARM_MINUTES_AE_M;
583583
}
584584

585585
if (mask & RTC_ALARM_TIME_MASK_HOUR) {

0 commit comments

Comments
 (0)