Fix missing magnetometer support on NEXUSX target #11157
Merged
+4
−0
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.
User description
Summary
Fixes "Invalid name" CLI error when users attempt to configure magnetometer settings on NEXUSX target.
Problem
The NEXUSX target was missing
USE_MAGdefinition, causing all magnetometer-related CLI settings to be excluded from the settings table. Users received "Invalid name" errors when trying to use:set align_mag_roll=<value>set align_mag_pitch=<value>set align_mag_yaw=<value>Root Cause
The PG_COMPASS_CONFIG parameter group in settings.yaml has
condition: USE_MAG(line 558), which excludes all magnetometer settings when USE_MAG is not defined for the target.Solution
Added magnetometer support to NEXUSX target:
#define USE_MAGto target.hMAG_I2C_BUSto use I2C3 (same bus as barometer)Hardware Compatibility
NEXUSX board has I2C3 available for external magnetometer:
Testing
✅ Built NEXUSX target successfully
✅ Verified settings present in binary via strings command
✅ All compass settings now available:
Impact
Files Changed
src/main/target/NEXUSX/target.h- Added USE_MAG and MAG_I2C_BUS definitionsPR Type
Bug fix
Description
Enables missing magnetometer support on NEXUSX target
Adds USE_MAG definition and configures MAG_I2C_BUS to I2C3
Resolves "Invalid name" CLI errors for compass settings
Allows external magnetometer configuration via I2C3 bus
Diagram Walkthrough
File Walkthrough
target.h
Enable magnetometer on I2C3 bussrc/main/target/NEXUSX/target.h
#define USE_MAGto enable magnetometer support#define MAG_I2C_BUS BUS_I2C3to configure magnetometer I2C busmag_hardware, mag_declination, etc.)