From: Uwe Hermann Date: Sat, 1 Feb 2014 13:46:52 +0000 (+0100) Subject: avr_isp: Fix a bug resulting in incorrect start samples. X-Git-Tag: libsigrokdecode-0.3.0~132 X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=commitdiff_plain;h=011ed1a3b28553b9932b5acbc74c6f19ab4c1eed avr_isp: Fix a bug resulting in incorrect start samples. --- diff --git a/decoders/avr_isp/pd.py b/decoders/avr_isp/pd.py index be8ee29..05a46ec 100644 --- a/decoders/avr_isp/pd.py +++ b/decoders/avr_isp/pd.py @@ -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