From: Wolfram Sang Date: Wed, 26 Apr 2017 15:17:31 +0000 (+0200) Subject: sdcard_sd: always show CMD argument in hex X-Git-Tag: libsigrokdecode-0.5.0~43 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=619ed6b4ef103f1dc0d4a03b68447a44cd2f12d6;p=libsigrokdecode.git sdcard_sd: always show CMD argument in hex This is especially useful with the default handler, so you can better understand the transfer if you are already familiar with CMD numbers and their arguments. It makes it also easier to compare with the debug output of the e.g. Linux Kernel. Signed-off-by: Wolfram Sang --- diff --git a/decoders/sdcard_sd/pd.py b/decoders/sdcard_sd/pd.py index b544b37..1ad9cb6 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)