Browse Source

Improve sync packet handling

master
Jim Paris 4 years ago
parent
commit
ae4b0081c8
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      itm-decode.py

+ 2
- 2
itm-decode.py View File

@@ -40,7 +40,7 @@ class ITMParser:
# Resync
if data == 0x00:
sync_count += 1
elif sync_count == 7 and data == 0x80:
elif sync_count >= 7 and data == 0x80:
raise ResyncException()
else:
sync_count = 0
@@ -82,7 +82,7 @@ class ITMParser:
"""

if c & 0x7f == 0:
return color("yellow", "sync")
return None # part of sync packet

if c == 0x70:
return color("yellow", "overflow")


Loading…
Cancel
Save