diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2014-02-02 21:03:47 +0100 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2014-02-09 19:38:20 +0100 |
commit | 808c6e7496410ea473c1a625530fd15f779b542e (patch) | |
tree | 0001c1e3f7ee484ceacaf43a20ca978f67865dd9 /decoders/spi | |
parent | bbc100f764f523dbc63daed84be5011432685e9a (diff) | |
download | libsigrokdecode-808c6e7496410ea473c1a625530fd15f779b542e.tar.gz libsigrokdecode-808c6e7496410ea473c1a625530fd15f779b542e.zip |
spi: Fix incorrect dataword endsample numbers.
Diffstat (limited to 'decoders/spi')
-rw-r--r-- | decoders/spi/pd.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/decoders/spi/pd.py b/decoders/spi/pd.py index 2d971d3..cd40946 100644 --- a/decoders/spi/pd.py +++ b/decoders/spi/pd.py @@ -150,9 +150,11 @@ class Decoder(srd.Decoder): # Dataword annotations. if self.have_miso: - self.putw([0, ['%02X' % self.misodata]]) + ss, es = self.misobits[0][1], self.misobits[-1][2] + self.put(ss, es, self.out_ann, [0, ['%02X' % self.misodata]]) if self.have_mosi: - self.putw([1, ['%02X' % self.mosidata]]) + ss, es = self.mosibits[0][1], self.mosibits[-1][2] + self.put(ss, es, self.out_ann, [1, ['%02X' % self.mosidata]]) def reset_decoder_state(self): self.misodata = 0 if self.have_miso else None @@ -187,7 +189,7 @@ class Decoder(srd.Decoder): else: self.mosidata |= mosi << self.bitcount - # Guesstimate the endsample for this bit (can be overridden later). + # Guesstimate the endsample for this bit (can be overridden below). es = self.samplenum if self.bitcount > 0: es += self.samplenum - self.misobits[self.bitcount - 1][1] |