Skip to content

Rework displayio display bus transaction handling during refresh #1620

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
merged 3 commits into from
Mar 7, 2019

Conversation

dhalbert
Copy link
Collaborator

@dhalbert dhalbert commented Mar 6, 2019

Success or failure of starting a display-bus transaction is now checked. For some routines, we busy-wait for the bus. For the background display refresh task, we just give up if the bus is not currently available.

Meant to fix #1612 and #1619.

@dhalbert dhalbert requested review from tannewt and jerryneedell March 6, 2019 18:48
@jerryneedell
Copy link
Collaborator

Ran a test on a feather_nerf52840 with a TFT featherwing --If I configure displayio then run the stmpe610 test using SPI, the stmpe610 test runs normally, but it causes the display to be deactivated -- that is I no longer see REPL output on the screen and even after a soft reboot, I can't get the REPL to show up on the screen again. If I run the slideshow - it does not show any images. No erros, but no images. If I hard reset, the slideshow (non-sd) runs normally. The slideshow from the SD card runs as above, no errors, but no images.


Press any key to enter the REPL. Use CTRL-D to reload.
Adafruit CircuitPython 4.0.0-beta.2-200-gc854f6617 on 2019-03-06; Adafruit Feather nRF52840 Express with nRF52840
>>> import slideshow_sd
cats1.bmp            Size: 37.0 KB
IMG_0493.bmp         Size: 37.0 KB
IMG_1027.bmp         Size: 66.2 KB
skye1.bmp            Size: 46.2 KB
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "slideshow_sd.py", line 56, in <module>
  File "adafruit_slideshow.py", line 200, in __init__
  File "adafruit_slideshow.py", line 318, in advance
KeyboardInterrupt: 

@jerryneedell
Copy link
Collaborator

on a pyportal slideshowsd seems to run fine

@jerryneedell
Copy link
Collaborator

also as in #1612, with this PR I can still mount/access the SDCard with the displayio device active -- teh REPL is echoing all the activity running a script from the SDCard.

@jerryneedell
Copy link
Collaborator

as suggested by @dhalbert Tried adding a delay in the stmpe610 read_data loop. Added a .25 sec delay -- this works -- the display continues to echo the REPL throughout the test and after the program is stopped with a control-c.

… display. Clarify code. Handle multiple displays better.
@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 7, 2019

@jerryneedell I fixed some remaining problems, and tested on PyPortal and a TFT FeatherWing with Feather M4 reading from SD card. Seems to work now. Might work better with STMPE also.

@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 7, 2019

Feel free not to test tonight :)

@dhalbert dhalbert changed the title check display-bus transaction status and act accordingly Rework displayio display bus transaction handling during refresh Mar 7, 2019
@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 7, 2019

@tannewt Besides some general cleanup, this fix locks the SPI bus as necessary, but unlocks it between buffer writes, which gives the SD card code the access to read image data.

@jerryneedell
Copy link
Collaborator

jerryneedell commented Mar 7, 2019

Tested on feather_nrf52840 with TFT featherwing:
slideshow from SD Card worked normally!
stmpe610 test worked with one issue that is more a problem with the test than CP.
When the displayio device is in use, there is a noticable slowdown in the execution speed at the REPL. You can see it just typing. the response is sluggish.
For a device like the stmpe610 that buffers data quickly, this resulted in some significant lag issues. But that will likely have to be addressed by the user code.

The "sluggishness" is not new -- It has always been present when using displayio on the feather_nrf52840.

Do you see the same on the feather_m4? - I have not tried it recently.

tested on pyportal -- slideshow from SDCard worked normally
aslo tested mounting and executing a script from the SDCard -- worked fine
Note: the responsiveness of the REPL in the PyPortal is much better than on the feather_nrf52840.
The "sluggishness" mentioned above is not apparent.

This PR looks good to me -- I see it failed the German Metro M0 build on Travis as I found yesterday :-(

jerryneedell
jerryneedell previously approved these changes Mar 7, 2019
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.

Made some notes in comments. Worked well on Feather_nrf52840 w/TFT featherwing and Pyportal.

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.

reapproving after fix for metro_m0 build

@dhalbert
Copy link
Collaborator Author

dhalbert commented Mar 7, 2019

Travis is confused: both builds have finished successfully, but it hasn't noticed.

@dhalbert dhalbert merged commit 2de8236 into adafruit:master Mar 7, 2019
@dhalbert dhalbert deleted the display-transactions-fix branch March 7, 2019 15:19
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.

displayio and SPI conflict
2 participants