- for _ in range(1 if width < 1334 else 2):
- bits <<= 1
- bits |= bit
- bit ^= 1
- self.verbose and print(bin(bits)) # Matches inverted scope waveform
- # Decode Manchester code
- x = 30
- while not bits >> x:
- x -= 1
- m0 = 1 << x # Mask MS two bits (always 01)
- m1 = m0 << 1
- v = 0 # 14 bit bitstream
- for _ in range(14):
- v <<= 1
- b0 = (bits & m0) > 0
- b1 = (bits & m1) > 0
- if b0 == b1:
+ # width is 889/1778 nominal
+ width = ticks_diff(self._times[x + 1], self._times[x])
+ if not 500 < width < 2100:
+ self.verbose and print('Bad block 3 Width', width, 'x', x)