-
Notifications
You must be signed in to change notification settings - Fork 132
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
refactor: deduplicate i2c parameters #188
Conversation
Pulls common i2c macros (e.g. GPIO pins, speed, etc.) into a common header, to deduplicate and increase maintainability. Also adds missing include for DS4432U.h in DS4432U.c.
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.
can you also please remove i2c_master_init(void) from DS4432.c and put it in the main file ?
i planned to do such a PR myself, so I will help yours instead |
Thank you very much for the review @Georges760! Good idea. Does something like the following sound good to you?
If so, I will make those changes (and any needed updates to CMakeLists |
@tdb3 are you able to do the additional commit ? I need it to move forward, sorry to push. If you are busy, I can merge as it and do the additional change myself. Tell me. |
Thanks for pinging. Sorry, I'm a bit busy right now on another project. I saw a few more opportunities for deduplicating i2c functions beyond |
refactor: deduplicate i2c parameters
DS4432U, EMC2101, and INA2101 all contain the same macros for I2C bus usage.
This PR deduplicates code by pulling these i2c macros into a common header.
Also, since
DS4432U.c
was being touched, opportunistically added missing include forDS4432U.h
.