-
Notifications
You must be signed in to change notification settings - Fork 72
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
Allow reclaiming display pins #118
Allow reclaiming display pins #118
Conversation
Hi, sorry for the late review! Two issues I found while testing this PR:
@therealprof Do you have any thoughts on this? |
I think either way should be fine (single or double-release that is). |
In fact, to release everything, I need 3 :) let interface = graphics_mode.release().release();
let (spi, dc, cs) = interface.release(); Personally, I don't mind these. It's kind of an onion that we have to peel, but in the end, everything should release just its own resources IMO. Although, on second thought, the user doesn't necessarily face/know about the DisplayProperties object that is returned by GraphicsMode::release() - it was actually a surprise for me, I thought, based on the Builder interface, that the SPIInterface object would be returned... Anyway, this PR is kind of the minimal change to implement a functionality I need, without breaking existing API. I admit, using it is kinda unwieldy. |
Ah jeez that's not good 😂
Yeah, it's a somewhat internal object to the driver, even though it's How about changing |
My concern with that is breaking existing code. But if you think that can be justified, it sounds fine. |
I'd be ok with that personally. I don't think the current |
I think it is wildly used but I don't mind breakage for quality-of-life improvements at all. In the end we're still learning and evolving the whole ecosystem quite a bit... |
All right, I'll cook something up soon :) Thanks! |
I've implemented Also, this still needs |
Yeah, I guess we can remove some more layers some time. |
0c9a13e
to
90f67a1
Compare
@jamwaffles How do we want to proceed with this with #119 in mind? Land it before or defer until #119 is in? |
I don't have a lot of bandwidth to check the conflicts at the moment, but my gut feeling would be to land #119 first |
This doesnt have conflicts and 119 is easy to rebase, but their order matters little IMO |
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.
After another quick look, I think we should rename .properties()
to .into_properties()
or something else that conveys the consumption of the display into a Properties
object. Currently, .properties()
sounds to me like it should return a reference or something else non-destructive.
Agreed & done. |
5797b98
to
3a84fce
Compare
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.
Found some small issues
Co-authored-by: James Waples <[email protected]>
9a2dd19
to
91c5249
Compare
Thanks! |
master
if you're not already up to dateCHANGELOG.md
entry in the Unreleased section under the appropriate heading (Added, Fixed, Changed, etc)rustfmt
on the project withcargo fmt --all
- CI will not pass without this stepPR description
Hi!
I have a device that can physically cut supply to the display. In order to do that, I must ensure that the pins are floating or low, so I must be able to deconstruct the display driver to reclaim the pins.
This is a no-brainer implementation of the above functionality. Any feedback is welcome, if there is a better place to do this, or if the feature is already there but I'm blind. I've also bumped the display-interface dependencies because I rely on those as well.
Other todo items will be checked once this PR can get a green light.
Thank you :)