From: Uwe Hermann Date: Wed, 19 Feb 2014 14:11:24 +0000 (+0100) Subject: spi: Fix a bug when only supplying MOSI (but not MISO). X-Git-Tag: libsigrokdecode-0.3.0~85 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=8e8096e8289d8c5a5adf75109e481fe734e629f8;p=libsigrokdecode.git spi: Fix a bug when only supplying MOSI (but not MISO). --- diff --git a/decoders/spi/pd.py b/decoders/spi/pd.py index 679335e..d077cca 100644 --- a/decoders/spi/pd.py +++ b/decoders/spi/pd.py @@ -193,7 +193,10 @@ class Decoder(srd.Decoder): # Guesstimate the endsample for this bit (can be overridden below). es = self.samplenum if self.bitcount > 0: - es += self.samplenum - self.misobits[0][1] + if self.have_miso: + es += self.samplenum - self.misobits[0][1] + elif self.have_mosi: + es += self.samplenum - self.mosibits[0][1] if self.have_miso: self.misobits.insert(0, [miso, self.samplenum, es])