From 3ce6b565eff9b04c9e1a6912de7c2acff958dcae Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Fri, 16 Jun 2017 09:47:12 +0200 Subject: [PATCH] Possible fix/workaround for OSX frequency trimming --- stcgal/protocols.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/stcgal/protocols.py b/stcgal/protocols.py index 316eb02..39b008c 100644 --- a/stcgal/protocols.py +++ b/stcgal/protocols.py @@ -114,7 +114,11 @@ def read_packet(self): # read and check frame start magic packet = bytes() - packet += self.read_bytes_safe(1) + # XXX: skip extraneous 0xFE byte? + leading = self.read_bytes_safe(1) + if leading == 0xfe: + leading = self.read_bytes_safe(1) + packet += leading # Some (?) BSL versions don't send a frame start with the status # packet. Let's be liberal and accept that always, just in case. if packet[0] == self.PACKET_MCU[0]: