Skip to content
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

Add support for I2C Realtime Clocks #400

Merged
merged 46 commits into from
Jan 18, 2025
Merged

Conversation

chrisib
Copy link
Collaborator

@chrisib chrisib commented Jan 6, 2025

Add a new experimental module to add realtime clock support. Currently testing with a DS3231 module, though the DS1307 should also be compatible.

I'll add an additional contrib script or two that actually make use of this feature before marking this as ready for review. Likely something inspired by Pet Rock and/or Almanac, as both of those make good use of RTC capabilities.

chrisib added 11 commits January 5, 2025 19:12
…on to support additional clocks, including NTP servers (in theory)
…nter is fine with). Re-order methods inside the RealtimeClock class
…ting the time. Move some code around, add a __str__ function to the clock class so we can print the time with print(clock). Add some supporting data structures to get the name of the weekday or month. Validate the datetime tuple before setting the clock.
@chrisib chrisib added firmware Software related issue new script Addition of a new contrib script labels Jan 9, 2025
…in the current month & year, is_leap_year flag. Static methods renamed. Fix a bug in the wonk generation that could result in out-of-bounds errors
…y update time, or for midnight; otherwise use UTC
…y're the same negative length adjustment they won't be wholly synchronized
…ns and only 1 special phase per cycle. Fix a bug where we accidentally swapped waning for waxing in the phase calculations
@chrisib chrisib marked this pull request as ready for review January 17, 2025 02:29
@benjaminvdb
Copy link

This is a big one. Very impressive! 🙇 I'm still waiting for my RTC module and I'm hoping to give it a test run soon. Thanks!

@poedigital
Copy link

i have two installed here, works like a charm. have a script done already that i'll upload soon...

@chrisib
Copy link
Collaborator Author

chrisib commented Jan 17, 2025

i have two installed here, works like a charm.

That's great! I'm glad it's working for people who aren't me.

i have a script done already that i'll upload soon...

I'm planning on merging this feature into main over the weekend and bump the version. Once that's done it should be a lot easier to add additional contrib scripts that make use of the RTC feature.

@chrisib chrisib merged commit 18e8f4c into Allen-Synthesis:main Jan 18, 2025
3 checks passed
@chrisib chrisib deleted the i2c-rtc branch January 18, 2025 05:52
@chrisib chrisib restored the i2c-rtc branch January 18, 2025 05:52
@chrisib chrisib deleted the i2c-rtc branch January 18, 2025 05:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
firmware Software related issue new script Addition of a new contrib script
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants