fix(pitotmeter): guard MS5525 i2c address writes with USE_I2C for SITL builds#11570
Merged
sensei-hacker merged 1 commit intoMay 19, 2026
Conversation
SITL target undefines USE_I2C, so the i2c member of the busdev union does not exist in that build. Wrap the two address-assignment lines with #ifdef USE_I2C so the code compiles without hardware I2C support.
Contributor
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Test firmware build ready — commit Download firmware for PR #11570 234 targets built. Find your board's
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The MS5525 pitotmeter driver failed to compile for SITL targets because it directly accessed
pitot->busDev->busdev.i2c.address, but thei2cunion member inbusDevice_t.busdevis conditionally compiled under#ifdef USE_I2C. The SITL target explicitly#undef USE_I2C(target.h), so the member does not exist in that build.Changes
busdev.i2c.addressassignment lines inpitotmeter_ms5525.cwith#ifdef USE_I2C/#endif, matching the pattern already used throughoutbus.handbus.cTesting
ninja -j4inbuild_sitl/)USE_I2Cis defined — the guards are compile-time onlyCode Review
Reviewed for correctness and INAV coding standards — no issues found. The fix mirrors the existing
#ifdef USE_I2Cpattern used inbus.candbus.hfor all directbusdevunion member accesses.