summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2019-04-15 19:46:04 +0200
committerUwe Hermann <uwe@hermann-uwe.de>2019-04-15 19:46:04 +0200
commitebe297ad9703b4d8212a0799ad5ef06aa59ac6b7 (patch)
tree6ae9c0df4a2e4d880bb0785dae312bb565e4f711
parent8f461b610c0887db253dc289471beeb1da6f08ea (diff)
downloadlibsigrokdecode-ebe297ad9703b4d8212a0799ad5ef06aa59ac6b7.tar.gz
libsigrokdecode-ebe297ad9703b4d8212a0799ad5ef06aa59ac6b7.zip
sdcard_spi: handle_data_response(): Shorten a few lines.
-rw-r--r--decoders/sdcard_spi/pd.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/decoders/sdcard_spi/pd.py b/decoders/sdcard_spi/pd.py
index 1e02756..94055ce 100644
--- a/decoders/sdcard_spi/pd.py
+++ b/decoders/sdcard_spi/pd.py
@@ -397,15 +397,16 @@ class Decoder(srd.Decoder):
# This is not the byte we are waiting for.
# Should we return to IDLE here?
return
- self.put(self.miso_bits[7][1], self.miso_bits[5][2], self.out_ann, [134, ['Don\'t care']])
- self.put(self.miso_bits[4][1], self.miso_bits[4][2], self.out_ann, [134, ['Always 0']])
+ m = self.miso_bits
+ self.put(m[7][1], m[5][2], self.out_ann, [134, ['Don\'t care']])
+ self.put(m[4][1], m[4][2], self.out_ann, [134, ['Always 0']])
if miso == 0x05:
- self.put(self.miso_bits[3][1], self.miso_bits[1][2], self.out_ann, [134, ['Data accepted']])
+ self.put(m[3][1], m[1][2], self.out_ann, [134, ['Data accepted']])
elif miso == 0x0b:
- self.put(self.miso_bits[3][1], self.miso_bits[1][2], self.out_ann, [134, ['Data rejected (CRC error)']])
+ self.put(m[3][1], m[1][2], self.out_ann, [134, ['Data rejected (CRC error)']])
elif miso == 0x0d:
- self.put(self.miso_bits[3][1], self.miso_bits[1][2], self.out_ann, [134, ['Data rejected (write error)']])
- self.put(self.miso_bits[0][1], self.miso_bits[0][2], self.out_ann, [134, ['Always 1']])
+ self.put(m[3][1], m[1][2], self.out_ann, [134, ['Data rejected (write error)']])
+ self.put(m[0][1], m[0][2], self.out_ann, [134, ['Always 1']])
ann_class = None
if self.is_cmd24:
ann_class = 24