Skip to content

drivers: rtc: mchp_g1: initialize unsupported rtc_time fields - #1

Draft
MilhoNerfado wants to merge 1 commit into
mainfrom
rtc_mchp_g1.c-fix-unused
Draft

drivers: rtc: mchp_g1: initialize unsupported rtc_time fields#1
MilhoNerfado wants to merge 1 commit into
mainfrom
rtc_mchp_g1.c-fix-unused

Conversation

@MilhoNerfado

Copy link
Copy Markdown
Collaborator

The get_alarm_time and get_clock_time functions were leaving tm_wday, tm_yday, tm_isdst, and tm_nsec uninitialized after populating the rtc_time struct. These fields are not backed by hardware registers, so callers would read indeterminate values.

Set tm_wday, tm_yday, and tm_isdst to -1 (unsupported/unknown) and tm_nsec to 0, matching the convention used by other RTC drivers in Zephyr.

The get_alarm_time and get_clock_time functions were leaving
tm_wday, tm_yday, tm_isdst, and tm_nsec uninitialized after
populating the rtc_time struct. These fields are not backed by
hardware registers, so callers would read indeterminate values.

Set tm_wday, tm_yday, and tm_isdst to -1 (unsupported/unknown)
and tm_nsec to 0, matching the convention used by other RTC
drivers in Zephyr.

Signed-off-by: Emilio Bottoni <emilio.bottoni@vertex.org.br>
@MilhoNerfado MilhoNerfado self-assigned this Jun 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant