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

restore len(alarm.sleep_memory) and bool(alarm.sleep_memory) #3958

Merged
merged 1 commit into from
Jan 11, 2021

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Jan 9, 2021

Fixes #3956.

This was originally copied over from microcontroller.nvm, and then after a discussion with @tannewt, was deleted. I didn't mean to delete len() . And on reflection, I think bool() can stay: it's small and cheap, and there's a off-chance that an implementation might provide a zero-length alarm.sleep_memory(say, for instance, its size was dynamically chosen) and that needs to have proper falsiness.

@dhalbert dhalbert requested review from tannewt and anecdata January 9, 2021 03:35
Copy link
Member

@anecdata anecdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adafruit CircuitPython 6.1.0-rc.0-13-ga589c2630 on 2021-01-09; Saola 1 w/Wrover with ESP32S2
>>> import alarm
>>> len(alarm.sleep_memory)
4096

Thanks, Dan! I looked at it and tried a few things, but I was way off.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks!

@tannewt tannewt merged commit 1fb3d24 into adafruit:main Jan 11, 2021
@dhalbert dhalbert deleted the sleep_memory-len-and-bool branch January 13, 2021 02:43
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.

len(alarm.sleep_memory) would be very useful
3 participants