X-Git-Url: https://sigrok.org/gitweb/?p=libsigrokdecode.git;a=blobdiff_plain;f=decoders%2Fsdcard_spi%2Fpd.py;h=0850c305831e2c15e468901691d472b4ce568a4c;hp=f92be0d550d31cfd4d1ed8c407c19201f82845cd;hb=c761524941fcb2237ceb65082e504e5e48e62a05;hpb=c82620fc0b10c9541b8a92bd3ea3dd4bdf982390 diff --git a/decoders/sdcard_spi/pd.py b/decoders/sdcard_spi/pd.py index f92be0d..0850c30 100644 --- a/decoders/sdcard_spi/pd.py +++ b/decoders/sdcard_spi/pd.py @@ -69,11 +69,12 @@ cmd_name = { 51: 'SEND_SCR', } -def ann_cmd_list(): +def cmd_list(): l = [] for i in range(63 + 1): - l.append(['cmd%d' % i, 'CMD%d' % i]) - return l + l.append(('cmd%d' % i, 'CMD%d' % i)) + + return tuple(l) class Decoder(srd.Decoder): api_version = 1 @@ -84,19 +85,16 @@ class Decoder(srd.Decoder): license = 'gplv2+' inputs = ['spi'] outputs = ['sdcard_spi'] - probes = [] - optional_probes = [] - options = {} - annotations = ann_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'], - ] + 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', @@ -118,7 +116,6 @@ class Decoder(srd.Decoder): self.cmd_str = '' def start(self): - # self.out_python = self.register(srd.OUTPUT_PYTHON) self.out_ann = self.register(srd.OUTPUT_ANN) def putx(self, data):