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

Improved sleep_for, allows alarms up to 28 days long #16

Merged
merged 1 commit into from
May 24, 2023

Conversation

ahnlak
Copy link
Contributor

@ahnlak ahnlak commented Apr 24, 2023

Leaning heavily (read: copying) on similar work done for Inky Frames, expanded sleep_for() function to allow for sleeps longer than 24 hours - by adding the day component to the alarm, this maximum can be stretched to a month (capped at 28 days)

@Gadgetoid
Copy link
Member

Thank you. I don't know why it didn't occur to me to switch into epoch time and back to handle rollover. Wood for the trees I suppose.

@Gadgetoid Gadgetoid merged commit 5d3b139 into pimoroni:main May 24, 2023
@ahnlak
Copy link
Contributor Author

ahnlak commented May 24, 2023

Ahh, the advantage of decades of C programming where you don't have any meaningful date routines so you just automatically reduce all dates/times to a long int and do maths 🤣

@ahnlak ahnlak deleted the longer_sleep_for branch May 24, 2023 09:12
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.

2 participants