summaryrefslogtreecommitdiff
path: root/decoders
diff options
context:
space:
mode:
authorUwe Hermann <uwe@hermann-uwe.de>2020-01-11 00:17:44 +0100
committerUwe Hermann <uwe@hermann-uwe.de>2020-01-11 00:17:44 +0100
commit1e9dfe605f11ce2535a740e20555bbc439c0fc1a (patch)
tree9d81e4a3936248f8eaeebea9507d21fc88f09235 /decoders
parent4437df0c3bdd3c5650d02624f7d0431f82f24362 (diff)
downloadlibsigrokdecode-1e9dfe605f11ce2535a740e20555bbc439c0fc1a.tar.gz
libsigrokdecode-1e9dfe605f11ce2535a740e20555bbc439c0fc1a.zip
sdcard_sd: Remove a list that needs manual maintenance.
Instead of checking if a command is in a fixed list/tuple (that needs to be manually updated every time a new command becomes supported), simply check if the respective handling method for the command exists. This fixes the bug of the CMD16 handler not being called, and will prevent similar bugs in the future.
Diffstat (limited to 'decoders')
-rw-r--r--decoders/sdcard_sd/pd.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/decoders/sdcard_sd/pd.py b/decoders/sdcard_sd/pd.py
index b6a076b..32a25ae 100644
--- a/decoders/sdcard_sd/pd.py
+++ b/decoders/sdcard_sd/pd.py
@@ -181,7 +181,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, 6, 7, 8, 9, 10, 13, 41, 51, 55):
+ if hasattr(self, 'handle_%s%d' % (s.lower(), self.cmd)):
self.state = St['HANDLE_CMD%d' % self.cmd]
else:
self.state = St.HANDLE_CMD999