X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=decoders%2Fsdcard_sd%2Fpd.py;h=835a544b47839e25e599d6ddd7c7af0fa9507e32;hb=d507f5e445906d8e90f643b18dc23c455f8569a8;hp=02e78d72191c5a37b4b5b63efdfc603324629a73;hpb=1153584350aeba4a58aa5bd54aeb2fcd33126c22;p=libsigrokdecode.git diff --git a/decoders/sdcard_sd/pd.py b/decoders/sdcard_sd/pd.py index 02e78d7..835a544 100644 --- a/decoders/sdcard_sd/pd.py +++ b/decoders/sdcard_sd/pd.py @@ -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):