Skip to content

Conversation

@sensei-hacker
Copy link
Member

@sensei-hacker sensei-hacker commented Dec 6, 2025

PR Type

Enhancement, Documentation


Description

  • Add MSP2_INAV_SET_GVAR command for global variable control

  • Update MSP protocol documentation with new GVAR message

  • Add comprehensive release creation guide for maintainers

  • Fix documentation links and enum references


Diagram Walkthrough

flowchart LR
  A["MSP Protocol"] -->|"Add SET_GVAR"| B["fc_msp.c"]
  A -->|"Define 0x2214"| C["msp_protocol_v2_inav.h"]
  D["MSP Documentation"] -->|"Update messages"| E["msp_messages.json"]
  D -->|"Update reference"| F["msp_ref.md"]
  G["Developer Docs"] -->|"Add release guide"| H["release-create.md"]
  I["Maintenance"] -->|"Fix links/enums"| J["LedStrip.md & inav_enums_ref.md"]
Loading

File Walkthrough

Relevant files
Enhancement
2 files
fc_msp.c
Implement MSP2_INAV_SET_GVAR command handler                         
+17/-0   
msp_protocol_v2_inav.h
Define MSP2_INAV_SET_GVAR protocol constant                           
+2/-1     
Documentation
6 files
msp_messages.json
Document MSP2_INAV_SET_GVAR message structure                       
+23/-0   
msp_ref.md
Add MSP2_INAV_SET_GVAR to protocol reference                         
+16/-1   
rev
Increment MSP documentation revision number                           
+1/-1     
inav_enums_ref.md
Fix enum names and add wind offset operand                             
+4/-3     
release-create.md
Add comprehensive INAV release creation guide                       
+345/-0 
LedStrip.md
Update Oscar Liang guide link to current URL                         
+2/-2     
Miscellaneous
1 files
msp_messages.checksum
Update checksum for MSP messages                                                 
+1/-1     

xznhj8129 and others added 11 commits November 29, 2025 11:14
The NEXUSX target was missing USE_MAG definition, which caused all
magnetometer-related CLI settings to be unavailable. Users received
"Invalid name" errors when attempting to configure align_mag_roll,
align_mag_pitch, align_mag_yaw, and other compass settings.

Changes:
- Added USE_MAG to NEXUSX target.h
- Configured MAG_I2C_BUS to use I2C3 (same bus as barometer)
- Enables external magnetometer support for GPS navigation

Hardware compatibility:
- NEXUSX has I2C3 available (SCL: PA8, SDA: PC9)
- Barometer already on I2C3 (SPL06)

Testing:
- Built NEXUSX target successfully
- Verified settings present in binary via strings command
- All compass settings now available in settings table:
  * align_mag_roll, align_mag_pitch, align_mag_yaw
  * mag_hardware, mag_declination
  * magzero_x/y/z, maggain_x/y/z
  * mag_calibration_time
updated link to Oscar Liang's guide
I2C3 is not physically accessible on NEXUSX hardware.
Changed MAG_I2C_BUS from BUS_I2C3 to DEFAULT_I2C (BUS_I2C2).
Added USE_MAG_ALL for auto-detection of magnetometer models.
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
Co-authored-by: qodo-code-review[bot] <151058649+qodo-code-review[bot]@users.noreply.github.com>
@github-actions
Copy link

github-actions bot commented Dec 6, 2025

Branch Targeting Suggestion

You've targeted the master branch with this PR. Please consider if a version branch might be more appropriate:

  • maintenance-9.x - If your change is backward-compatible and won't create compatibility issues between INAV firmware and Configurator 9.x versions. This will allow your PR to be included in the next 9.x release.

  • maintenance-10.x - If your change introduces compatibility requirements between firmware and configurator that would break 9.x compatibility. This is for PRs which will be included in INAV 10.x

If master is the correct target for this change, no action is needed.


This is an automated suggestion to help route contributions to the appropriate branch.

@qodo-code-review
Copy link
Contributor

qodo-code-review bot commented Dec 6, 2025

PR Compliance Guide 🔍

All compliance sections have been disabled in the configurations.

Comment on lines +2344 to +2359
case MSP2_INAV_SET_GVAR:
if (dataSize != 5) {
return MSP_RESULT_ERROR;
}
{
uint8_t gvarIndex;
if (!sbufReadU8Safe(&gvarIndex, src)) {
return MSP_RESULT_ERROR;
}
const int32_t gvarValue = (int32_t)sbufReadU32(src);
if (gvarIndex >= MAX_GLOBAL_VARIABLES) {
return MSP_RESULT_ERROR;
}
gvSet(gvarIndex, gvarValue);
}
break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Verify the new MSP ID is consistently defined and documented everywhere (header, handler switch, JSON/docs) to keep one source of truth. Ensure the numeric value (0x2214/8724) matches the docs and header constant. [Learned best practice, importance: 6]

Suggested change
case MSP2_INAV_SET_GVAR:
if (dataSize != 5) {
return MSP_RESULT_ERROR;
}
{
uint8_t gvarIndex;
if (!sbufReadU8Safe(&gvarIndex, src)) {
return MSP_RESULT_ERROR;
}
const int32_t gvarValue = (int32_t)sbufReadU32(src);
if (gvarIndex >= MAX_GLOBAL_VARIABLES) {
return MSP_RESULT_ERROR;
}
gvSet(gvarIndex, gvarValue);
}
break;
case MSP2_INAV_SET_GVAR: // 0x2214 (8724), must match msp_protocol_v2_inav.h and docs
if (dataSize != 5) {
return MSP_RESULT_ERROR;
}
uint8_t gvarIndex;
if (!sbufReadU8Safe(&gvarIndex, src)) {
return MSP_RESULT_ERROR;
}
const int32_t gvarValue = (int32_t)sbufReadU32(src);
if (gvarIndex >= MAX_GLOBAL_VARIABLES) {
return MSP_RESULT_ERROR;
}
gvSet(gvarIndex, gvarValue);
break;

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this suggestion change any code, or just add a comment without any other changes?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ask

Does this suggestion change any code, or just add a comment without any other changes?

Answer:

It only adds an inline comment/annotation next to the case label and does not alter the actual code logic or behavior.

…support

Fix missing magnetometer support on NEXUSX target
@sensei-hacker sensei-hacker merged commit 68546a2 into master Dec 7, 2025
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants