diff options
author | Uwe Hermann <uwe@hermann-uwe.de> | 2019-04-19 00:02:54 +0200 |
---|---|---|
committer | Uwe Hermann <uwe@hermann-uwe.de> | 2019-04-19 00:28:11 +0200 |
commit | 4c58713b0d536f37b8630ebd142185aa56946335 (patch) | |
tree | 022c9b1dddbb0dc4321aa1a6d43d53098568cb03 /decoders | |
parent | 743457ac2bf657f903c379bca4ca248dcfd7cef3 (diff) | |
download | libsigrokdecode-4c58713b0d536f37b8630ebd142185aa56946335.tar.gz libsigrokdecode-4c58713b0d536f37b8630ebd142185aa56946335.zip |
cc1101: Simplify format_command().
Diffstat (limited to 'decoders')
-rw-r--r-- | decoders/cc1101/pd.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/decoders/cc1101/pd.py b/decoders/cc1101/pd.py index 24352f6..de0d74f 100644 --- a/decoders/cc1101/pd.py +++ b/decoders/cc1101/pd.py @@ -118,22 +118,17 @@ class Decoder(srd.Decoder): def format_command(self): '''Returns the label for the current command.''' if self.cmd == 'SINGLE_READ': - reg = regs[self.dat] if self.dat in regs else 'unknown register' return 'Read' if self.cmd == 'BURST_READ': - reg = regs[self.dat] if self.dat in regs else 'unknown register' return 'Burst read' if self.cmd == 'SINGLE_WRITE': - reg = regs[self.dat] if self.dat in regs else 'unknown register' return 'Write' if self.cmd == 'BURST_WRITE': - reg = regs[self.dat] if self.dat in regs else 'unknown register' return 'Burst write' if self.cmd == 'STATUS_READ': - reg = regs[self.dat] if self.dat in regs else 'unknown register' return 'Status read' if self.cmd == 'STROBE_CMD': - reg = strobes[self.dat] if self.dat in strobes else 'unknown strobe' + reg = strobes.get(self.dat, 'unknown strobe') return 'STROBE "{}"'.format(reg) else: return 'TODO Cmd {}'.format(self.cmd) |