Skip to content

Refactor library. #2

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

Merged
merged 14 commits into from
Dec 15, 2023
Merged

Refactor library. #2

merged 14 commits into from
Dec 15, 2023

Conversation

SFE-Brudnerd
Copy link
Contributor

Full refactor of the library.
Works with SparkFun Toolkit.
Reduced complexity.
Added comments.

Delete toolkit files.
Migrate registers file to header.
Refactor of library in progress.
Still need to finish commenting.
Update constructor defaults.
Add getter for device Address.
Add getters for outputs.
Edit comments for brevity.
Make fsr variables const instead of static constexpr.
Consolidate begin functions.
Add nullptr checks.
Incorporate new readRegisterRegion functions.
Rework prepareMeasurement.
Add comments.
Add dependency.
Copy link
Member

@gigapod gigapod left a comment

Choose a reason for hiding this comment

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

Overall looks solid - glad it's working!

Thanks for MAJOR refactor work.

Copy link

@sfe-SparkFro sfe-SparkFro left a comment

Choose a reason for hiding this comment

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

Overall looks really good!

Update Examples to say halting rather than spinning.
Add comments about why break time is set.
Move driver to it's own underlying file.
Make getDeviceID change op mode if needed.
Add checking to setDeviceAddress.
Make runDefaultSetup change op mode if needed.
Move bulk of runDefaultSetup into the else statement so we don't do unnecessary things.
prepareMeasurement now uses references and consts.
Add comment to reset about OSR register availability.
Add human readable versions of getters for gain, cclk, convTime.
Rename original versions of those to Raw.
Remove unnecessary if's in readRawUV.
setDigitalDividerRange now defaults enabling the divider to true.
Modify Arduino begin to take in a wire port.
Remove unnecessary reset call in begin due to logic changes above.
Make default case for setDeviceAddress do nothing.
Manually setOSR in getDeviceID.
@SFE-Brudnerd SFE-Brudnerd merged commit c4b61e3 into main Dec 15, 2023
@SFE-Brudnerd SFE-Brudnerd deleted the work branch December 15, 2023 23:57
@gigapod
Copy link
Member

gigapod commented Dec 16, 2023

A lot of comments/commits - if you need me to look at anything just let me know...

@SFE-Brudnerd
Copy link
Contributor Author

I think we're all set now.

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.

4 participants