Adjust bitmask for 13-bit altitude codes with q bit.
Replaced the 14-bit 0x3F80 with 13-bit 0x1F80. (The 14-bit mask would have produced correct results as long as the input is 13 bit.)
This commit is contained in:
parent
3bad1f5d35
commit
ee41c2b3cc
@ -48,7 +48,7 @@ def decode_alt(alt, bit13):
|
|||||||
#in this representation, the altitude bits are as follows:
|
#in this representation, the altitude bits are as follows:
|
||||||
# 12 11 10 9 8 7 (6) 5 (4) 3 2 1 0
|
# 12 11 10 9 8 7 (6) 5 (4) 3 2 1 0
|
||||||
# so bits 6 and 4 are the M and Q bits, respectively.
|
# so bits 6 and 4 are the M and Q bits, respectively.
|
||||||
tmp1 = (alt & 0x3F80) >> 2
|
tmp1 = (alt & 0x1F80) >> 2
|
||||||
tmp2 = (alt & 0x0020) >> 1
|
tmp2 = (alt & 0x0020) >> 1
|
||||||
else:
|
else:
|
||||||
tmp1 = (alt & 0x1FE0) >> 1
|
tmp1 = (alt & 0x1FE0) >> 1
|
||||||
|
Loading…
Reference in New Issue
Block a user