]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/sdcard_sd/pd.py
sdcard_sd: really show result of SET_BLOCKLEN
[libsigrokdecode.git] / decoders / sdcard_sd / pd.py
index 02e78d72191c5a37b4b5b63efdfc603324629a73..835a544b47839e25e599d6ddd7c7af0fa9507e32 100644 (file)
@@ -135,7 +135,8 @@ class Decoder(srd.Decoder):
                                'CMD%d' % self.cmd, 'Cmd', 'C']])
 
         # CMD[39:08]: Argument
-        self.putf(8, 39, [132, ['Argument', 'Arg', 'A']])
+        self.arg = int('0b' + ''.join([str(s[i][2]) for i in range(8, 40)]), 2)
+        self.putf(8, 39, [132, ['Argument: 0x%08x' % self.arg, 'Arg', 'A']])
 
         # CMD[07:01]: CRC7
         self.crc = int('0b' + ''.join([str(s[i][2]) for i in range(40, 47)]), 2)
@@ -164,7 +165,7 @@ class Decoder(srd.Decoder):
         # Handle command.
         s = 'ACMD' if self.is_acmd else 'CMD'
         self.cmd_str = '%s%d (%s)' % (s, self.cmd, self.cmd_name(self.cmd))
-        if self.cmd in (0, 2, 3, 4, 6, 7, 8, 9, 10, 13, 41, 51, 55):
+        if self.cmd in (0, 2, 3, 6, 7, 8, 9, 10, 13, 41, 51, 55):
             self.state = 'HANDLE CMD%d' % self.cmd
         else:
             self.state = 'HANDLE CMD999'
@@ -230,9 +231,8 @@ class Decoder(srd.Decoder):
 
     def handle_cmd16(self):
         # CMD16 (SET_BLOCKLEN) -> R1
-        self.blocklen = self.arg
         self.puta(0, 31, [136, ['Block length', 'Blocklen', 'BL', 'B']])
-        self.putc(16, 'Set the block length to %d bytes' % self.blocklen)
+        self.putc(16, 'Set the block length to %d bytes' % self.arg)
         self.token, self.state = [], 'GET RESPONSE R1'
 
     def handle_cmd55(self):