]> sigrok.org Git - libsigrokdecode.git/commitdiff
cec: Replace unneeded decode_opcode().
authorUwe Hermann <redacted>
Sun, 9 Sep 2018 15:35:55 +0000 (17:35 +0200)
committerUwe Hermann <redacted>
Sun, 9 Sep 2018 15:39:01 +0000 (17:39 +0200)
decoders/cec/pd.py
decoders/cec/protocoldata.py

index a742f81b326be761a266260373fdfdbb3d5ba98d..4028b7e2af8fbd4c95cf9f537df0708e6e78b0fa 100644 (file)
@@ -136,7 +136,7 @@ class Decoder(srd.Decoder):
                 (src, dst) = decode_header(self.cmd_bytes[i]['val'])
                 str = 'HDR: ' + src + ', ' + dst
             elif i == 1: # Parse opcode
-                str += ' | OPC: ' + decode_opcode(self.cmd_bytes[i]['val'])
+                str += ' | OPC: ' + opcodes.get(self.cmd_bytes[i]['val'], 'Invalid')
             else: # Parse operands
                 if operands == 0:
                     str += ' | OPS: '
index fb8049480a4151cd23d76abf4c2e968266b8623e..833ac7f5e9f4fe2a5b4451bfb343eb5254a89488 100644 (file)
@@ -115,9 +115,3 @@ def decode_header(header):
     src = (header & 0xF0) >> 4
     dst = (header & 0x0F)
     return (resolve_logical_address(src, 1), resolve_logical_address(dst, 0))
-
-def decode_opcode(opcode):
-    if opcode in opcodes:
-        return opcodes[opcode]
-    else:
-        return 'Invalid'