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:
Lars Lindqvist 2016-08-15 12:53:08 +02:00
parent 3bad1f5d35
commit ee41c2b3cc

View File

@ -48,7 +48,7 @@ def decode_alt(alt, bit13):
#in this representation, the altitude bits are as follows:
# 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.
tmp1 = (alt & 0x3F80) >> 2
tmp1 = (alt & 0x1F80) >> 2
tmp2 = (alt & 0x0020) >> 1
else:
tmp1 = (alt & 0x1FE0) >> 1