mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-09-23 10:18:30 +08:00
fix(gps): correct GPS_UBX_CFG_INTF bitmask max to 63 (#28716)
GPS_UBX_CFG_INTF declares six bits (0-5), so its range is 0-63, but it declares max: 32. 32 is the value of the highest bit on its own (I2C_OUT_PROT_RTCM3X = 1 << 5), not the all-bits-set value, so every value from 33 to 63 is published to ground stations as out of range. The smallest of them is UBX input plus RTCM3X output on I2C, 1 + 32. The parameter was introduced indf441ac202with all six bits and max: 32 in the same hunk, so the mask never outgrew its maximum. GPS_1_GNSS and GPS_2_GNSS in the same file are also six-bit masks and both declare max: 63. They were corrected from 31 to 63 inc90ccabbe0when NAVIC was added as their sixth bit, which is the same arithmetic. Tools/module_config/generate_params.py derives (1 << (max_bit + 1)) - 1 for a bitmask with no explicit max, which is 63 here. The metadata check in srcparser.py validates each bit on its own, int(min) <= 2**index <= int(max), so 2**5 = 32 <= 32 passes by exactly one and the inconsistency was never flagged. This is ground-station metadata only: min and max are not compiled into the firmware, so runtime behaviour is unchanged. Assisted-by: Claude:claude-opus-5 Signed-off-by: Qutibah Ananzeh <38795261+Ti-03@users.noreply.github.com>
This commit is contained in:
@@ -180,7 +180,7 @@ parameters:
|
||||
5: Enable I2C output protocol RTCM3X
|
||||
default: 0
|
||||
min: 0
|
||||
max: 32
|
||||
max: 63
|
||||
reboot_required: true
|
||||
GPS_UBX_PPK:
|
||||
description:
|
||||
|
||||
Reference in New Issue
Block a user