Skip to content

Why is the alarm year & month hardcoded to Jan 2017? #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
maholli opened this issue Jun 6, 2024 · 3 comments
Open

Why is the alarm year & month hardcoded to Jan 2017? #53

maholli opened this issue Jun 6, 2024 · 3 comments

Comments

@maholli
Copy link

maholli commented Jun 6, 2024

When reading an alarm set point, the tm_year attribute is hardcoded to return 2017 and tm_mon to return 1. Is this intentional? Caused by a limitation somewhere?

time.struct_time((2017, 1, mday, hour, minute, seconds, wday, mday, -1)),

In contrast, reading the datetime properly returns the year reported from the RTC:

_bcd2bin(self.buffer[7] & self.mask_datetime[7]) + 2000,

@tannewt
Copy link
Member

tannewt commented Jun 7, 2024

I don't remember. It was probably just a known point in time to base the frequency on. Maybe look in the DS3231 (iirc) datasheet for clues.

@maholli
Copy link
Author

maholli commented Jun 7, 2024

@tannewt yeah the DS3231 alarm registers specify the time up to the day (date). Not sure how you want this helper library to handle it, but at the very least the docs should include a warning.

@tannewt
Copy link
Member

tannewt commented Jun 10, 2024

PR to update the doc would be great!

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

No branches or pull requests

2 participants