Skip to content
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

Move bounded drawing calculation from interfaces into the only call site #113

Conversation

therealprof
Copy link
Collaborator

Hi! Thank you for helping out with SSD1306 development!

Please:

  • Check that you've added documentation to any new methods
  • Rebase from master if you're not already up to date
  • Add or modify an example if there are changes to the public API
  • Add a CHANGELOG.md entry in the Unreleased section under the appropriate heading (Added, Fixed, Changed, etc)
  • Run rustfmt on the project with cargo fmt --all - CI will not pass without this step
  • Check that your branch is up to date with master and that CI is passing once the PR is opened

PR description

Remove some code duplication in bounded box drawing by moving the bounding box calculation from the interface specific send_bounded_data into the only call site and reuse the regular send_data function.

Copy link
Collaborator

@jamwaffles jamwaffles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, weird that we didn't do this previously. Tested on hardware and looks good to me. Isn't this a breaking change though? Probably nobody is using send_bounded_data, but it's public. Can you add a breaking changelog entry saying it's been moved private or something?

Copy link
Collaborator

@jamwaffles jamwaffles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops wrong button

@therealprof
Copy link
Collaborator Author

It's a bit weird that this is a world-public interface. But I've added the entry as requested.

@therealprof
Copy link
Collaborator Author

NB: I've also tested the I2C version of this in one of my projects.

@jamwaffles
Copy link
Collaborator

It's a bit weird that this is a world-public interface. But I've added the entry as requested.

It should probably be private, no? I'm happy to make that breaking change. If someone really wants it, we can come up with a better solution down the road.

p.s. needs a rebase

@therealprof
Copy link
Collaborator Author

@jamwaffles Privatizing doesn't really work, already tried. It's too exposed but hey, maybe we're completely changing it anyways. 😅

Copy link
Collaborator

@jamwaffles jamwaffles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. Please merge when you want to.

@therealprof therealprof merged commit 6dfba59 into rust-embedded-community:master Mar 23, 2020
@therealprof therealprof deleted the bounded-draw-calculation branch March 23, 2020 11:45
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.

2 participants