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

Extract I2C calls to private methods to eliminate duplication #38

Merged
merged 4 commits into from
Jul 16, 2024

Conversation

EngJay
Copy link
Owner

@EngJay EngJay commented Jul 16, 2024

Summary

The I2C reads and writes follow the same patterns and were repeated throughout the driver methods.

The duplicated code for reading and writing single a single byte and reading multiple bytes has been extracted to private methods. Calls to the private methods have been swapped into the public methods.

Details

No additional details.

Testing

This was a pure refactor, so no new tests were needed.

Checklist

  • I have added or updated doc comments for my code changes.
  • I have added or updated comments to difficult-to-understand code.
  • I have made corresponding changes to the documentation.
  • My changes generate no new warnings or errors.

@EngJay EngJay merged commit 86c7e99 into main Jul 16, 2024
4 checks passed
@EngJay EngJay deleted the 36-extract-i2c-calls branch July 16, 2024 02:05
@EngJay EngJay self-assigned this Sep 28, 2024
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.

i2c calls are only a few patterns repeated in methods
1 participant