-
Notifications
You must be signed in to change notification settings - Fork 70
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
Remove DisplayMode #119
Remove DisplayMode #119
Conversation
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 actually looks pretty good to me so far, so thanks for taking the time to clean this crate up a bit!
After running cargo fmt
and TARGET=thumbv7m-none-eabi ./build.sh
, I see the noise_i2c.rs
fails to compile. The call to disp.release()
should be replaced with disp.properties()
(which incidentally is what I should've used in the first place!)
There's also a now-broken doc link as RawMode
is removed. I haven't checked the docs yet but there are likely some paragraphs that can be removed now.
Not so much a superset, but I branched off of that PR in case this one is rejected or that one is accidentally merged :) It's not about duplicate functionality, but incremental changes. I have one more addition to make: brightness adjustment. Should I include it in this PR as well? |
Ok, understood! I notice both commits from the other PR are included in this one though, so it might be a good idea to rebase this PR from master to keep all these PRs more tightly scoped.
More additions always welcome! I would prefer this to be in a separate PR if you don't mind. For one thing, it helps keep the changelog organised :) |
Unfortunately, rebasing this to master would cause some conflict so it would be more work than merging #118 and then continuing work on this one. I'll tidy that one up first. |
Ok, no worries :) |
That is superweird and unexpected. But it's a good idea to keep seperate things separate anyway. |
f9615ec
to
bc1ff12
Compare
This enabled reclaiming gpios which may be necessary for some hardware configurations to enter low power mode
bc1ff12
to
3a788cc
Compare
I've spent some time cleaning up the links. Unfortunately, it looks like the link checker doesn't know about inter-crate link format and fails, however I believe it is the preferred linking format since Also, no longer based on #118 |
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.
Looking good so far, just some small things I picked up.
Unfortunately, it looks like the link checker doesn't know about inter-crate link format and fails
That's correct. The linkchecker in the build script was only ever designed for http://
links.
I really like the intra doc link feature and would much prefer to use it, but as it's currently still nightly I'd prefer to keep the relative path links for now.
src/lib.rs
Outdated
//! returns a [`DisplayProperties`] instance which is a low level interface to manipulate the display properties (e.g. rotation). | ||
//! You can coerce the driver into a more useful mode by calling `into()` and defining the type you want to coerce to. For |
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.
Please wrap this to 100 columns.
While we're here, I'd also suggest rewording the You can coerce the driver
part to The driver can be coerced
.
src/builder.rs
Outdated
//! | ||
//! [`I2CDIBuilder`]: crate::builder::I2CDIBuilder | ||
//! [`DisplayProperties`]: crate::properties::DisplayProperties | ||
//! [`GraphicsMode`]: crate::mode::graphics::GraphicsMode | ||
//! [`TerminalMode`]: crate::mode::terminal::TerminalMode |
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.
Much cleaner, thanks. As mentioned in the review comments, please change these links (and all others in the PR) back to relative paths. Linkchecker and manual docs surfing should help here.
I'll make the changes once I'm at a computer, but are the intra-crate links really nightly? I'll also double check that but I think they are stable, at least docs.rs knows about them IIRC. |
Unfortunately yes, at least until rust-lang/rust#43466 is closed I guess. As for docs.rs, https://docs.rs/about states that:
Which is why they work there. |
Nice cleanup. Would be great to land this. |
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.
Excellent.
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.
👌
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.
Argh, one last thing I didn't catch before in the changelog. I doubt many people were using RawMode
but its removal is technically a breaking change.
The name is also incorrect which might be confusing to anybody migrating code using the changelog.
Co-authored-by: James Waples <[email protected]>
I hope you don't mind if I took the lazy way of pressing the Commit suggestion button 😅 |
No problem - I squash merged this PR anyway :). Thanks for the changes! |
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
This PR removes the DisplayMode struct. As far as I can tell, DisplayMode is only used currently as the return value of Builder::connect() and it is immediately transformed into a specific DisplayModeTrait implementation.
This PR also removes the now obsolete RawMode which was closely connected to the above mechanism.
This is only a proposal and I fully expect it to be rejected. Also, the Into trait is not implemented for the display modes, as for some reason I get trait impl conflicts when I attempt to do so.