Skip to content

Don't wait for display frame if interrupt pending #1604

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

Merged

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Mar 1, 2019

common_hal_displayio_display_wait_for_frame() would call the background tasks over and over. If a reload was pending, displayio_refresh_displays() would stop refreshing, but common_hal_displayio_display_wait_for_frame() didn't know that.

The effect was that writes to CIRCUITPY would cause the board to apparently freeze (because the display was frozen). It was really cycling in the background task, never to return.

Details:

  • Check for pending interrupts in common_hal_displayio_display_wait_for_frame().
  • In displayio_refresh_displays():
    • Check for KeyboardInterrupt immediately (otherwise sometimes two ctrl-C's were needed)
    • Don't bother to re- raise ReloadException if it was already raised.

I believe this fixes freezes seen by @ladyada, who will test in a few days.

This may or may not have something to do with #1577.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 4, 2019

@jerryneedell you tested this, I think? Could you approve so we can get wider testing on this? Thanks.

Copy link
Collaborator

@jerryneedell jerryneedell left a comment

Choose a reason for hiding this comment

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

I complied and tested this on pyportal and feather_m4. I did not have any issues with it. It did not resolve the SPI issues I have been seeing.

@dhalbert dhalbert merged commit 146271f into adafruit:master Mar 4, 2019
@dhalbert dhalbert deleted the display_wait_for_frame-check-interrupts branch March 4, 2019 18:55
@tannewt
Copy link
Member

tannewt commented Mar 8, 2019

Looks good to me too! Thanks for fixing this while I was away.

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.

3 participants