Skip to content

Commit ba406b6

Browse files
Merge pull request #11262 from sensei-hacker/feature/gps-hwversion-msp
Add GPS hardware version to MSP and optimize defaults for M8/M9/M10
2 parents 50d0ea8 + ebd3769 commit ba406b6

File tree

5 files changed

+18
-8
lines changed

5 files changed

+18
-8
lines changed

docs/Settings.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1734,11 +1734,11 @@ Which SBAS mode to be used
17341734

17351735
### gps_ublox_nav_hz
17361736

1737-
Navigation update rate for UBLOX receivers. Some receivers may limit the maximum number of satellites tracked when set to a higher rate or even stop sending navigation updates if the value is too high. Some M10 devices can do up to 25Hz. 10 is a safe value for M8 and newer.
1737+
Navigation update rate for UBLOX receivers. M9 modules limit satellite tracking to 16 satellites at 10Hz or higher, but use 32 satellites below 10Hz for better accuracy. M10 modules work well at 8Hz with 3 constellations. Some M10 devices with high-performance clock can do up to 25Hz with 4 constellations. 8Hz is a safe, accurate default for M8/M9/M10.
17381738

17391739
| Default | Min | Max |
17401740
| --- | --- | --- |
1741-
| 10 | 5 | 200 |
1741+
| 8 | 5 | 200 |
17421742

17431743
---
17441744

@@ -1748,7 +1748,7 @@ Enable use of Beidou satellites. This is at the expense of other regional conste
17481748

17491749
| Default | Min | Max |
17501750
| --- | --- | --- |
1751-
| OFF | OFF | ON |
1751+
| ON | OFF | ON |
17521752

17531753
---
17541754

@@ -1758,7 +1758,7 @@ Enable use of Galileo satellites. This is at the expense of other regional const
17581758

17591759
| Default | Min | Max |
17601760
| --- | --- | --- |
1761-
| OFF | OFF | ON |
1761+
| ON | OFF | ON |
17621762

17631763
---
17641764

docs/development/msp/msp_messages.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4911,6 +4911,12 @@
49114911
"ctype": "uint16_t",
49124912
"desc": "Estimated Vertical Position Accuracy (`gpsSol.epv`)",
49134913
"units": "cm"
4914+
},
4915+
{
4916+
"name": "hwVersion",
4917+
"ctype": "uint32_t",
4918+
"desc": "GPS hardware version (`gpsState.hwVersion`). Values: 500=UBLOX5, 600=UBLOX6, 700=UBLOX7, 800=UBLOX8, 900=UBLOX9, 1000=UBLOX10, 0=UNKNOWN",
4919+
"units": "Version code"
49144920
}
49154921
]
49164922
},

src/main/fc/fc_msp.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,6 +1009,7 @@ static bool mspFcProcessOutCommand(uint16_t cmdMSP, sbuf_t *dst, mspPostProcessF
10091009
sbufWriteU16(dst, gpsSol.hdop);
10101010
sbufWriteU16(dst, gpsSol.eph);
10111011
sbufWriteU16(dst, gpsSol.epv);
1012+
sbufWriteU32(dst, gpsState.hwVersion);
10121013
break;
10131014
#endif
10141015
case MSP2_ADSB_VEHICLE_LIST:

src/main/fc/settings.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1757,12 +1757,12 @@ groups:
17571757
type: uint8_t
17581758
- name: gps_ublox_use_galileo
17591759
description: "Enable use of Galileo satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires M8N and Ublox firmware 3.x (or later) [OFF/ON]."
1760-
default_value: OFF
1760+
default_value: ON
17611761
field: ubloxUseGalileo
17621762
type: bool
17631763
- name: gps_ublox_use_beidou
17641764
description: "Enable use of Beidou satellites. This is at the expense of other regional constellations, so benefit may also be regional. Requires gps hardware support [OFF/ON]."
1765-
default_value: OFF
1765+
default_value: ON
17661766
field: ubloxUseBeidou
17671767
type: bool
17681768
- name: gps_ublox_use_glonass
@@ -1777,8 +1777,8 @@ groups:
17771777
min: 5
17781778
max: 10
17791779
- name: gps_ublox_nav_hz
1780-
description: "Navigation update rate for UBLOX receivers. Some receivers may limit the maximum number of satellites tracked when set to a higher rate or even stop sending navigation updates if the value is too high. Some M10 devices can do up to 25Hz. 10 is a safe value for M8 and newer."
1781-
default_value: 10
1780+
description: "Navigation update rate for UBLOX receivers. M9 modules limit satellite tracking to 16 satellites at 10Hz or higher, but use 32 satellites below 10Hz for better accuracy. M10 modules work well at 8Hz with 3 constellations. Some M10 devices with high-performance clock can do up to 25Hz with 4 constellations. 8Hz is a safe, accurate default for M8/M9/M10."
1781+
default_value: 8
17821782
field: ubloxNavHz
17831783
type: uint8_t
17841784
min: 5

src/main/io/gps.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,9 @@ void gpsInit(void)
451451
gpsStats.errors = 0;
452452
gpsStats.timeouts = 0;
453453

454+
// Initialize hardware version to unknown (for MSP_GPSSTATISTICS)
455+
gpsState.hwVersion = 0;
456+
454457
// Reset solution, timeout and prepare to start
455458
gpsResetSolution(&gpsSolDRV);
456459
gpsResetSolution(&gpsSol);

0 commit comments

Comments
 (0)