drivers: rtc: rtc_mc146818: Patch incorrect field comparisons
Minutes and hour values are incorrectly compared with MAX_SEC. Compare minutes and hour to MAX_MIN and MAX_HOUR respectively. Signed-off-by: Daniel Kampert <DanielKampert@kampis-elektroecke.de>
This commit is contained in:
parent
87dbd81168
commit
246e614ac3
@ -377,13 +377,13 @@ static int rtc_mc146818_alarm_get_time(const struct device *dev, uint16_t id, ui
|
||||
}
|
||||
|
||||
value = rtc_read(RTC_ALARM_MIN);
|
||||
if (value <= MAX_SEC) {
|
||||
if (value <= MAX_MIN) {
|
||||
timeptr->tm_min = value;
|
||||
(*mask) |= RTC_ALARM_TIME_MASK_MINUTE;
|
||||
}
|
||||
|
||||
value = rtc_read(RTC_ALARM_HOUR);
|
||||
if (value <= MAX_SEC) {
|
||||
if (value <= MAX_HOUR) {
|
||||
timeptr->tm_hour = value;
|
||||
(*mask) |= RTC_ALARM_TIME_MASK_HOUR;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user