-
Notifications
You must be signed in to change notification settings - Fork 13.4k
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
Pixhawk 6C external I2C bus hack #20200
Conversation
In terms of something we can live with, rather than a board define slipping into common code maybe we could flip it around so that DeviceExternal() respects something like an override list (or call) that the board support could optionally provide? |
If this goes in, then we should we remove this #20198 ? |
66e67d0
to
1f97149
Compare
@dagar I've updated it, have another look. I believe this is cleaner and doesn't have the board specific ifdef. |
@vincentpoont2 yes, this replaces #20198, and #20151. |
This #20198 just got merged and reverted fmuv6c I2C4 back to "internal" so that the board would start Baro & Mag automatically using Main FW.
@julianoes Does this need to move back to "external" with this hack? |
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.
LGTM
It may need to be expanded later to be a call out that the board could override but that is not worth the code space now. |
@vincentpoont2 yes, it needs to go back to external. |
1f97149
to
074d3a5
Compare
Everything look good on our test with this PR. @julianoes
|
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.
Looks good to me
This swaps the internal baro and mag back to the bus which is both internal an external but configured as external for this case.
074d3a5
to
e8ff08b
Compare
@dagar I've addressed your two comments, fixed up the original commit, rebased on master and force pushed. |
That looks good, I was just hoping to keep it a little more consistent with px4_i2c_bus_external. How's this? I wanted to make sure we capture the same notion of external consistently (I2C::external(), etc). |
@dagar your "hack" is much nicer. I will revert my changes, cherry-pick it here, and test it. |
This is a revert of the revert. This reverts commit 1080855.
e8ff08b
to
172eda5
Compare
Tested, the calibration is correct, and the |
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.
Much cleaner. What is the CI failure?
@davids5 looks unrelated. I'll create a separate PR to fix it.
|
This contains two changes:
This swaps the internal baro and mag back to the bus which is both internal an external but configured as external for this case, in the same way as Update fmu-v6c rc.board_sensors #20151.
Also, it adds a hack for fmu-v6c regarding mag calibration: In order for the mag calibration to treat the mag as an internal one, as well as sensors_status_mag and sensors_status_baro to be correct, we need to insert this override to change these two sensors specifically to internal.
FYI @vincentpoont2
Tests:
Mag calibration:
sensor status topics: