]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/rtc8564/rtc8564.py
srd: PDs: Whitespace and cosmetics.
[libsigrokdecode.git] / decoders / rtc8564 / rtc8564.py
index 0e7a532f5d8de55289704feb8c56f0fb63e5bb91..4ce6070ac6f2ff7971f2daa895e3769c2e834008 100644 (file)
@@ -18,9 +18,7 @@
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
-#
-# Epson RTC-8564 JE/NB decoder
-#
+# Epson RTC-8564 JE/NB protocol decoder
 
 import sigrokdecode as srd
 
@@ -47,14 +45,14 @@ class Decoder(srd.Decoder):
     inputs = ['i2c']
     outputs = ['rtc8564']
     probes = []
-    extra_probes = [
+    optional_probes = [
         {'id': 'clkout', 'name': 'CLKOUT', 'desc': 'TODO.'},
         {'id': 'clkoe', 'name': 'CLKOE', 'desc': 'TODO.'},
         {'id': 'int', 'name': 'INT#', 'desc': 'TODO.'},
     ]
     options = {}
     annotations = [
-        ['TODO', 'TODO'], 
+        ['TODO', 'TODO'],
     ]
 
     def __init__(self, **kwargs):
@@ -207,7 +205,7 @@ class Decoder(srd.Decoder):
                 self.state = READ_RTC_REGS2
                 return
             else:
-               pass # TODO
+                pass # TODO
         elif self.state == READ_RTC_REGS2:
             if cmd == 'DATA READ':
                 handle_reg = getattr(self, 'handle_reg_0x%02x' % self.reg)
@@ -223,6 +221,5 @@ class Decoder(srd.Decoder):
             else:
                 pass # TODO?
         else:
-            # Shouldn't happen.
-            raise Exception('Unknown state: %d', self.state)
+            raise Exception('Invalid state: %d' % self.state)