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

Open
bablokb opened this issue May 14, 2024 · 0 comments
Open

EPaperdisplay.time_to_refresh never reaches zero #9244

bablokb opened this issue May 14, 2024 · 0 comments
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

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

No branches or pull requests

3 participants