-
Notifications
You must be signed in to change notification settings - Fork 13.6k
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
Add const specifiers to posix and nuttx I2C class constructors and transfer() methods #12934
Conversation
The receive buffer shouldn't be const. |
Yes. Agreed. But we can expect the pointer to the buffer to not change during the execution of the method, though, right? |
Declare a pointer to a const uint8_t type. const uint8_t * buf Declare a const pointer to a uint8_t type. const * uint8_t buf Both. const * uint8_t * buf |
5c9baf0
to
505a339
Compare
Thanks for pointing that out @dagar, I've removed the I'm still curious how that worked at all: Let me know if you'd like to see anything else done with this PR! Thanks! |
505a339
to
9772e4e
Compare
@mcsauder can you rebase? |
9772e4e
to
cc55383
Compare
Rebased and commits squashed. Thanks for the ping @TSC21 ! |
…transfer() methods.
cc55383
to
64e6315
Compare
Closing, merged with PR #12695. |
Describe problem solved by the proposed pull request
This PR adds
const
specifiers to the posix and nuttx I2C class constructors and transfer() method arguments. Currently, a few of the arguments haveconst specifiers
and this work addsconst
to the remaining arguments.Test data / coverage
This PR was test flown on a 250 quad with pixhawk 4 mini. (The pixhawk mini primary mag, the IST8310, is I2C.)
Flight tests perform the same as current PX4:master branch
Please let me know if you have any questions on this PR! Thanks!
-Mark