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

EPaperdisplay.time_to_refresh never reaches zero #9244

Closed
bablokb opened this issue May 14, 2024 · 0 comments · Fixed by #9299
Closed

EPaperdisplay.time_to_refresh never reaches zero #9244

bablokb opened this issue May 14, 2024 · 0 comments · Fixed by #9299
Assignees
Milestone

Comments

@bablokb
Copy link

bablokb commented May 14, 2024

CircuitPython version

# all since PR #9140

Code/REPL

while display.time_to_refresh() > 0:
  time.sleep(display.time_to_refresh())

Behavior

endless loop

Description

In many of my programs I have the above conservative code snippet. Since PR #9140 this results in an endless loop, since the "fix" will always add 0.1.

When I change my code to

if display.time_to_refresh() > 0:
  time.sleep(display.time_to_refresh())

I don't have the endless loop, but I introduce an additional sleep even where it is actually not necessary.

Wouldn't it make more sense to add the offset to self.core->last_refresh directly? This would make the offset a one-time action and it would make sure that the timer actually expires.

Additional information

No response

@bablokb bablokb added the bug label May 14, 2024
@dhalbert dhalbert added this to the 9.x.x milestone May 14, 2024
dhalbert pushed a commit that referenced this issue Jun 4, 2024
Redo Feather C6 pinout so it include standard D# labels for feathers

Fixes #9244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants