GPS: fix hwVersion field size from uint32_t to uint8_t#11510
Merged
sensei-hacker merged 2 commits intoiNavFlight:maintenance-9.xfrom Apr 25, 2026
Merged
GPS: fix hwVersion field size from uint32_t to uint8_t#11510sensei-hacker merged 2 commits intoiNavFlight:maintenance-9.xfrom
sensei-hacker merged 2 commits intoiNavFlight:maintenance-9.xfrom
Conversation
Change gpsState.hwVersion from uint32_t to uint8_t and introduce a structured bit-field encoding for the hardware version byte: bits [7:6] = series (0b01 = u-blox Neo/M series) bits [5:0] = generation (e.g. 8=M8, 9=M9, 10=M10) Update UBX_HW_VERSION_* constants accordingly (e.g. M8=0x48, M9=0x49, M10=0x4A). Change MSP_GPSSTATISTICS to send hwVersion as a single byte (sbufWriteU8) instead of four bytes (sbufWriteU32). The bit-field layout reserves series values 0b10 and 0b11 for future chip families (e.g. u-blox F9, other manufacturers). Tested with M9 and M10 receivers — auto-detection working correctly.
4 tasks
|
Test firmware build ready — commit Download firmware for PR #11510 234 targets built. Find your board's
|
Collaborator
|
For the last 11 years we have had a conventention that MSP is a public API and we do not break public APIs. This would appear to change this convention. |
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
Follow-up to #11262. Changes
gpsState.hwVersionfromuint32_ttouint8_tand introduces a structured bit-field encoding for the hardware version byte sent viaMSP_GPSSTATISTICS:0b01= u-blox Neo/M series)Concrete values: M8=
0x48, M9=0x49, M10=0x4AThe encoding reserves series values
0b10and0b11for future chip families (u-blox F9, other manufacturers).Files changed:
src/main/io/gps_ublox.h— newUBX_HW_SERIES_*macros + updatedUBX_HW_VERSION_*constantssrc/main/io/gps_private.h—uint32_t hwVersion→uint8_t hwVersionsrc/main/fc/fc_msp.c—sbufWriteU32→sbufWriteU8src/main/io/gps_ublox.c— decode function return typeuint32_t→uint8_tTest plan
0x49, M9-precision preset auto-detected0x4A, M10 preset auto-detected