summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2014-02-19 15:11:24 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2014-02-19 15:21:06 +0100
commit8e8096e8289d8c5a5adf75109e481fe734e629f8 (patch)
treec2105055eb080178c192d9ec4d5c441c592016a3 /decoders
parentae036d3403ad9e301d41a68869ded51a54127bfe (diff)
downloadlibsigrokdecode-8e8096e8289d8c5a5adf75109e481fe734e629f8.tar.gz
libsigrokdecode-8e8096e8289d8c5a5adf75109e481fe734e629f8.zip
spi: Fix a bug when only supplying MOSI (but not MISO).
Diffstat (limited to 'decoders')
-rw-r--r--decoders/spi/pd.py5
1 files changed, 4 insertions, 1 deletions
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])