Conversation
`TELEM_RAK12500_ADDRESS` is defined inside an `#ifndef`, so a variant can override it, but `ublox_GNSS.begin(Wire)` never receives it and the SparkFun library falls back to its own default. The macro is the only `TELEM_*_ADDRESS` in this file that nothing consumes; every other one reaches its probe through the sensor table or a driver constructor. No variant overrides it today and the library default is also 0x42, so this changes no behaviour in the tree as it stands. It makes the knob mean what it says. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Advanced Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟢 Approval recommended
The change is minimal, matches the intended configuration behavior, and no issues were found in the updated call site.
Pull request overview
This PR fixes a latent configuration bug in the RAK12500 (u-blox GNSS over I2C) detection path by ensuring the variant-overridable TELEM_RAK12500_ADDRESS macro is actually used when probing the device.
Changes:
- Pass
TELEM_RAK12500_ADDRESSas the I2C address argument toublox_GNSS.begin(...)during RAK12500 initialization.
File summaries
| File | Description |
|---|---|
src/helpers/sensors/EnvironmentSensorManager.cpp |
Uses the configured (and variant-overridable) RAK12500 I2C address in the GNSS probe call. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Squashed onto |
The bug
src/helpers/sensors/EnvironmentSensorManager.cppdefines the RAK12500's I2C address inside an#ifndef, which is the file's convention for "a variant may override this":The probe then never passes it:
SFE_UBLOX_GNSS::beginis declaredbool begin(TwoWire &wirePort = Wire, uint8_t deviceAddress = 0x42, ...), so the address actuallyprobed is the library's own default, not the macro.
grep -rn TELEM_RAK12500_ADDRESS src/ variants/ platformio.ini examples/returns only the twolines of the definition itself. It is the one
TELEM_*_ADDRESSin this file that nothing consumes— every other one reaches its probe through the sensor table (
TELEM_AHTX_ADDRESS,TELEM_BME280_ADDRESS,TELEM_SHT4X_ADDRESS, …) or a driver constructor (TELEM_INA219_ADDRESS,TELEM_INA226_ADDRESS).Why it is latent, and why it is still worth fixing
No variant in the tree overrides the macro, and the library's default is also
0x42, so nothingdiverges today. The defect is that the knob exists and does nothing: a variant that overrode it —
which the
#ifndefinvites — would silently probe one address while every other reference to themacro named another, and the symptom would be a GPS that is simply not detected.
The fix
This is the only
ublox_GNSS.begincall site in the tree.Verification
(
SparkFun_u-blox_GNSS_Arduino_Library.h:715), not assumed.RAK_4631_repeaterbuilds. TheRAK_WISBLOCK_GPSblock is compiled into that env(
ENV_INCLUDE_GPS && RAK_BOARD && !RAK_WISMESH_TAG), confirmed by theublox_GNSSsymbol andthe SparkFun translation unit in the resulting ELF, so the changed line is actually built.
rather than a u-blox on I2C, so it takes the serial fallback and never reaches this line. A
board with an actual RAK12500 would be needed to exercise it, and since the address is unchanged
in-tree the observable behaviour would be identical either way.
Notes
This is a detection change rather than a reporting one, which is why it was kept out of the
hwinfoPR (#5) when CodeRabbit raised it there. Independent of that branch and of #6.Not upstream yet — this is the fork bake.
Summary by CodeRabbit