]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/avr_isp/pd.py
avr_isp: Fix a bug resulting in incorrect start samples.
[libsigrokdecode.git] / decoders / avr_isp / pd.py
index a0daf0bb73d25c1bac9765435ac17d7befb6a502..05a46ec541295bfaaa2c88a90f05c1582a61a87b 100644 (file)
@@ -49,7 +49,7 @@ class Decoder(srd.Decoder):
         self.xx, self.yy, self.zz, self.mm = 0, 0, 0, 0
 
     def start(self):
-        # self.out_proto = self.register(srd.OUTPUT_PYTHON)
+        # self.out_python = self.register(srd.OUTPUT_PYTHON)
         self.out_ann = self.register(srd.OUTPUT_ANN)
 
     def putx(self, data):
@@ -177,13 +177,13 @@ class Decoder(srd.Decoder):
 
         self.ss, self.es = ss, es
 
+        if len(self.mosi_bytes) == 0:
+            self.cmd_ss = ss
+
         # Append new bytes.
         self.mosi_bytes.append(mosi)
         self.miso_bytes.append(miso)
 
-        if len(self.mosi_bytes) == 0:
-            self.cmd_ss = ss
-
         # All commands consist of 4 bytes.
         if len(self.mosi_bytes) < 4:
             return