diff options
Diffstat (limited to 'decoders/spi/pd.py')
-rw-r--r-- | decoders/spi/pd.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/decoders/spi/pd.py b/decoders/spi/pd.py index fc8c7d0..ce007e2 100644 --- a/decoders/spi/pd.py +++ b/decoders/spi/pd.py @@ -152,6 +152,7 @@ class Decoder(srd.Decoder): self.out_binary = self.register(srd.OUTPUT_BINARY) self.out_bitrate = self.register(srd.OUTPUT_META, meta=(int, 'Bitrate', 'Bitrate during transfers')) + self.bw = (self.options['wordsize'] + 7) // 8 def putw(self, data): self.put(self.ss_block, self.samplenum, self.out_ann, data) @@ -165,10 +166,12 @@ class Decoder(srd.Decoder): if self.have_miso: ss, es = self.misobits[-1][1], self.misobits[0][2] - self.put(ss, es, self.out_binary, [0, bytes([so])]) + bdata = so.to_bytes(self.bw, byteorder='big') + self.put(ss, es, self.out_binary, [0, bdata]) if self.have_mosi: ss, es = self.mosibits[-1][1], self.mosibits[0][2] - self.put(ss, es, self.out_binary, [1, bytes([si])]) + bdata = si.to_bytes(self.bw, byteorder='big') + self.put(ss, es, self.out_binary, [1, bdata]) self.put(ss, es, self.out_python, ['BITS', si_bits, so_bits]) self.put(ss, es, self.out_python, ['DATA', si, so]) |