-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
paralleldisplay: reset and read pins should be optional #6118
Conversation
The ``reset`` and ``read`` pins should be optional, but the espressif code had several places where it assumed they are not, and a bug that caused a crash on ``release_displays`` if they were made optional. The bug was caused by the fields for storing pin numbers being set to ``NO_PIN``, which has value of -1, while the fields have type ``uint8_t``. That set the actual value to 255, and a subsequent comparison to ``NO_PIN`` returned false.
In other ports, |
You can always change it to |
I am just saying I think the initial idea of using |
Isn't it needed for compatibility with idf? |
Co-authored-by: Dan Halbert <halbert@halwitz.org>
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.
Thanks for the change! I'd like @tannewt to comment on the overall PR: I don't have much experience with displays.
Just a quick late night look but I do not think the atmel or rp2040 ports will work if the read pin is left out (likely a bug as well with them). Also in the espressif port I noticed |
You are right! I started this with the reset pin, and after checking in all the ports that they do have the code to make it optional, I noticed that the espressif port also has that code for the read pin, and assumed the other ports would as well. I will fix that.
It was there twice: https://github.com/adafruit/circuitpython/pull/6118/files#diff-6e4f17b3d8ddfa1af71ef1d81695db73526478965d2f456c14574a98bd32bb47R81 |
Looks like making the read pin optional took the build size over the edge for the Japanese translation of Matrix Portal M4. Should I revert that and just leave the reset pin as optional, or can we do something to make that one build fit? |
The matrixportal build has paralleldisplay enabled and clearly doesn't need it. You can disable it and then the build should fit. |
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.
This all looks good to me.
I shrank the matrixportal build here: eff6057 So if that works, and gets merged, we can merge this afterwards and you won't have to submit that patch. |
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.
Can merge now with shrink in from #6117.
The
reset
andread
pins should be optional, but the espressifcode had several places where it assumed they are not, and a bug that
caused a crash on
release_displays
if they were made optional.The bug was caused by the fields for storing pin numbers being set
to
NO_PIN
, which has value of -1, while the fields have typeuint8_t
. That set the actual value to 255, and a subsequentcomparison to
NO_PIN
returned false.