summaryrefslogtreecommitdiff
path: root/decoders/sdcard_spi
diff options
context:
space:
mode:
authorBert Vermeulen <bert@biot.com>2014-03-10 12:23:38 +0100
committerBert Vermeulen <bert@biot.com>2014-03-10 12:23:38 +0100
commitda9bcbd9f45b0153465c55ec726a0d76f6d7f01e (patch)
tree01190e6a1e52a3aedf5b2578716b8a470cd50fd0 /decoders/sdcard_spi
parentd1e2129c7b01a760d48bcc8e7fc12956a62698c1 (diff)
downloadlibsigrokdecode-da9bcbd9f45b0153465c55ec726a0d76f6d7f01e.tar.gz
libsigrokdecode-da9bcbd9f45b0153465c55ec726a0d76f6d7f01e.zip
Probes, optional probes and annotations now take a tuple.
Annotation entries also consist of a tuple, not a list.
Diffstat (limited to 'decoders/sdcard_spi')
-rw-r--r--decoders/sdcard_spi/pd.py28
1 files changed, 17 insertions, 11 deletions
diff --git a/decoders/sdcard_spi/pd.py b/decoders/sdcard_spi/pd.py
index c61c8c2..f10e4a0 100644
--- a/decoders/sdcard_spi/pd.py
+++ b/decoders/sdcard_spi/pd.py
@@ -69,6 +69,13 @@ cmd_name = {
51: 'SEND_SCR',
}
+def cmd_list():
+ l = []
+ for i in range(63 + 1):
+ l.append(('cmd%d' % i, 'CMD%d' % i))
+
+ return tuple(l)
+
class Decoder(srd.Decoder):
api_version = 1
id = 'sdcard_spi'
@@ -78,17 +85,16 @@ class Decoder(srd.Decoder):
license = 'gplv2+'
inputs = ['spi']
outputs = ['sdcard_spi']
- annotations = \
- [['cmd%d' % i, 'CMD%d' % i] for i in range(63 + 1)] + [
- ['cmd-desc', 'Command description'],
- ['r1', 'R1 reply'],
- ['r1b', 'R1B reply'],
- ['r2', 'R2 reply'],
- ['r3', 'R3 reply'],
- ['r7', 'R7 reply'],
- ['bits', 'Bits'],
- ['bit-warnings', 'Bit warnings'],
- ]
+ annotations = cmd_list() + (
+ ('cmd-desc', 'Command description'),
+ ('r1', 'R1 reply'),
+ ('r1b', 'R1B reply'),
+ ('r2', 'R2 reply'),
+ ('r3', 'R3 reply'),
+ ('r7', 'R7 reply'),
+ ('bits', 'Bits'),
+ ('bit-warnings', 'Bit warnings'),
+ )
annotation_rows = (
('bits', 'Bits', (70, 71)),
('cmd-reply', 'Commands/replies',