-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Sdcard odb fix #3449
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
Sdcard odb fix #3449
Conversation
What I'm thinking--but haven't tested:
This code in shared-modules/framebufferio/FramebufferDisplay.c needs to be changed so that it checks the return value of The use in shared-module/displayio/EPaperDisplay.c should be corrected too. I simply used |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the top level background check not enough? https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/__init__.c#L43-L44
No, it's not. We aren't entering background tasks recursively. We're entering refresh recursively: first from a foreground refresh() call, then from background tasks run during SD card accesses by OnDiskBitmap. |
Do we need the top level test then? Could we remove it? |
I think the test at https://github.com/adafruit/circuitpython/blob/main/shared-module/displayio/__init__.c#L43-L44 can be removed with or without this, because of |
Ok, @FoamyGuy please remove that outer display check. If you don't have time, let us know and we can finish it. Thanks! |
@tannewt I think the latest commit removes the check you were referring to. Let me know if I've misunderstood and removed something different, or if I missed something else that needs to go with it. I did not build this or test on a device after the latest commit. I can try that out later tonight. |
Yup! Thank you. That is what I was thinking. |
I had missed one instance of that boolean variable being used. The latest commit takes care of that. I did also build this version tonight and run it on a PyPortal and verify that the adafruit_sdcard and ondiskbitmap are still working properly. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Thank you!
An RGBMatrix has no bus and no bus_free method. It is always possible to refresh the display. This was not a problem before, but the fix I suggested (adafruit#3449) added a call to core_bus_free when a FramebufferDisplay was being refreshed. This was not caught during testing. This is a band-aid fix and it brings to light a second problem in which a SharpDisplay + FrameBuffer will not have a 'bus' object, and yet does operate using a shared SPI bus. This kind of display will need a "bus-free" like function to be added, or it can have problems like adafruit#3309.
Resolves #3309
Tested successfully with PyPortal.
@jepler helped create this fix for me. It was mentioned that there may need to be a similar solution added for framebuff APIs perhaps, that would be needed for the neopixels matrices if I understood correctly.
I think I have the appropriate hardware to try to tackle that now but I will need a bit more guidance into where that fix is it within the code and whether the same strategy used here is applicable for it.