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

Replace Measurement and UnscaledMeasurement with explicit Acceleration and MagneticField structs. #12

Merged
merged 14 commits into from
Aug 8, 2022

Conversation

reitermarkus
Copy link
Contributor

@reitermarkus reitermarkus commented Aug 5, 2022

Simplify the API by having only one method each for measuring, with the conversion (unscaled/mg/nT) being done by the explicit types.

Also included the changes from #11.

Copy link
Owner

@eldruin eldruin left a comment

Choose a reason for hiding this comment

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

Nice improvements, thank you!
Overall it looks very good to me. I would just skip bitflags as described in the other issue.
Could you also:

  • Add tests for the temperature enable/disable methods
  • Add tests for the raw version of the measurement methods
  • Add an entry to the changelog?

src/device_impl.rs Outdated Show resolved Hide resolved
src/device_impl.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
src/types.rs Show resolved Hide resolved
src/device_impl.rs Show resolved Hide resolved
@reitermarkus
Copy link
Contributor Author

Added tests for the raw methods and a changelog entry.

Copy link
Owner

@eldruin eldruin 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!
Could you also update the method list in the README as well?
Other than that this would be good to go.

Ugh, GH is showing a bunch of conflicts now that I merged #11 but git should be able to trivially merge them as I explicitly did not squash the commits.

src/device_impl.rs Outdated Show resolved Hide resolved
CHANGELOG.md Outdated Show resolved Hide resolved
Copy link
Owner

@eldruin eldruin 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, thank you for your work!

CHANGELOG.md Show resolved Hide resolved
@eldruin eldruin merged commit 7b51ed5 into eldruin:master Aug 8, 2022
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.

None yet

2 participants