]> sigrok.org Git - libsigrokdecode.git/commitdiff
srd: PDs: Whitespace and cosmetics.
authorUwe Hermann <redacted>
Mon, 27 Feb 2012 23:42:45 +0000 (00:42 +0100)
committerUwe Hermann <redacted>
Mon, 27 Feb 2012 23:42:45 +0000 (00:42 +0100)
decoders/edid/edid.py
decoders/i2c/i2c.py
decoders/i2cfilter/i2cfilter.py
decoders/nunchuk/nunchuk.py
decoders/rtc8564/rtc8564.py

index 78ea4f6767adacf67de09d0226fe220f15ea671c..a56bb572d5b30b6748adf417824c02cab4085fb1 100644 (file)
@@ -30,7 +30,6 @@
 import sigrokdecode as srd
 import os
 
 import sigrokdecode as srd
 import os
 
-
 EDID_HEADER = [0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00]
 OFF_VENDOR = 8
 OFF_VERSION = 18
 EDID_HEADER = [0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00]
 OFF_VENDOR = 8
 OFF_VERSION = 18
@@ -60,7 +59,7 @@ est_modes = [
     "1024x768@70Hz",
     "1024x768@75Hz",
     "1280x1024@75Hz",
     "1024x768@70Hz",
     "1024x768@75Hz",
     "1280x1024@75Hz",
-    "1152x870@75Hz"
+    "1152x870@75Hz",
 ]
 
 # X:Y display aspect ratios, as used in standard timing modes
 ]
 
 # X:Y display aspect ratios, as used in standard timing modes
@@ -68,14 +67,13 @@ xy_ratio = [
     (16, 10),
     (4, 3),
     (5, 4),
     (16, 10),
     (4, 3),
     (5, 4),
-    (16, 9)
+    (16, 9),
 ]
 
 # Annotation types
 ANN_FIELDS = 0
 ANN_SECTIONS = 1
 
 ]
 
 # Annotation types
 ANN_FIELDS = 0
 ANN_SECTIONS = 1
 
-
 class Decoder(srd.Decoder):
     api_version = 1
     id = 'edid'
 class Decoder(srd.Decoder):
     api_version = 1
     id = 'edid'
@@ -107,7 +105,7 @@ class Decoder(srd.Decoder):
         if type(data) != int:
             raise Exception('malformed ddc2 input: expected 1 byte')
         self.cnt += 1
         if type(data) != int:
             raise Exception('malformed ddc2 input: expected 1 byte')
         self.cnt += 1
-        self.sn.append( [ss, es] )
+        self.sn.append([ss, es])
         self.cache.append(data)
         # debug
 #        self.put(ss, es, self.out_ann, [0, ["%d: [%.2x]" % (self.cnt, data)]])
         self.cache.append(data)
         # debug
 #        self.put(ss, es, self.out_ann, [0, ["%d: [%.2x]" % (self.cnt, data)]])
@@ -258,7 +256,7 @@ class Decoder(srd.Decoder):
         elif dt == 1:
             dtstr = 'RGB color'
         elif dt == 2:
         elif dt == 1:
             dtstr = 'RGB color'
         elif dt == 2:
-            dtstr = 'non-RGB multicolor' 
+            dtstr = 'non-RGB multicolor'
         if dtstr:
             self.ann_field(offset+4, offset+4, "Display type: %s" % dtstr)
         if fs & 0x04:
         if dtstr:
             self.ann_field(offset+4, offset+4, "Display type: %s" % dtstr)
         if fs & 0x04:
@@ -430,15 +428,15 @@ class Decoder(srd.Decoder):
             # Monitor range limits
             self.put(self.sn[offset][0], self.sn[offset+17][1], self.out_ann,
                      [ANN_SECTIONS, ["Monitor range limits"]])
             # Monitor range limits
             self.put(self.sn[offset][0], self.sn[offset+17][1], self.out_ann,
                      [ANN_SECTIONS, ["Monitor range limits"]])
-            self.ann_field(offset+5, offset+5, "Minimum vertical rate: %dHz" % 
+            self.ann_field(offset+5, offset+5, "Minimum vertical rate: %dHz" %
                            self.cache[offset+5])
                            self.cache[offset+5])
-            self.ann_field(offset+6, offset+6, "Maximum vertical rate: %dHz" % 
+            self.ann_field(offset+6, offset+6, "Maximum vertical rate: %dHz" %
                            self.cache[offset+6])
                            self.cache[offset+6])
-            self.ann_field(offset+7, offset+7, "Minimum horizontal rate: %dkHz" % 
+            self.ann_field(offset+7, offset+7, "Minimum horizontal rate: %dkHz" %
                            self.cache[offset+7])
                            self.cache[offset+7])
-            self.ann_field(offset+8, offset+8, "Maximum horizontal rate: %dkHz" % 
+            self.ann_field(offset+8, offset+8, "Maximum horizontal rate: %dkHz" %
                            self.cache[offset+8])
                            self.cache[offset+8])
-            self.ann_field(offset+9, offset+9, "Maximum pixel clock: %dMHz" % 
+            self.ann_field(offset+9, offset+9, "Maximum pixel clock: %dMHz" %
                            (self.cache[offset+9] * 10))
             if self.cache[offset+10] == 0x02:
                 # Secondary GTF curve supported
                            (self.cache[offset+9] * 10))
             if self.cache[offset+10] == 0x02:
                 # Secondary GTF curve supported
@@ -464,6 +462,3 @@ class Decoder(srd.Decoder):
                 if self.cache[i+2] == 0 or self.cache[i+4] == 0:
                     self.decode_descriptor(i)
 
                 if self.cache[i+2] == 0 or self.cache[i+4] == 0:
                     self.decode_descriptor(i)
 
-
-
-
index b1c4a8acaf3080258cdbd186a5d5769cd641f2ee..7dce8e12dab31a980a7339608f43a9f7153f73a3 100644 (file)
@@ -33,9 +33,9 @@
 import sigrokdecode as srd
 
 # Annotation feed formats
 import sigrokdecode as srd
 
 # Annotation feed formats
-ANN_SHIFTED       = 0
+ANN_SHIFTED = 0
 ANN_SHIFTED_SHORT = 1
 ANN_SHIFTED_SHORT = 1
-ANN_RAW           = 2
+ANN_RAW = 2
 
 # Values are verbose and short annotation, respectively.
 protocol = {
 
 # Values are verbose and short annotation, respectively.
 protocol = {
index da816e6fe0e0d5766f54af65c40daf551b3c748d..6c1f4c862e300d80dcfe457aa4ecdad00fa06ffd 100644 (file)
@@ -74,4 +74,3 @@ class Decoder(srd.Decoder):
         else:
             raise Exception('Invalid state: %s' % self.state)
 
         else:
             raise Exception('Invalid state: %s' % self.state)
 
-
index f9019050439a359727e2b3c7bd754d818f0d4616..cd6fa213cdaec5297dd9cf22c2ea86bfa96643e2 100644 (file)
@@ -43,7 +43,7 @@ class Decoder(srd.Decoder):
     optional_probes = [] # TODO
     options = {}
     annotations = [
     optional_probes = [] # TODO
     options = {}
     annotations = [
-        ['TODO', 'TODO'], 
+        ['TODO', 'TODO'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
@@ -121,7 +121,7 @@ class Decoder(srd.Decoder):
             if self.state == IDLE:
                 self.state = INITIALIZED
             return
             if self.state == IDLE:
                 self.state = INITIALIZED
             return
-    
+
             if databyte == 0x40 and self.state == START:
                 self.state = INIT
             elif databyte == 0x00 and self.state == INIT:
             if databyte == 0x40 and self.state == START:
                 self.state = INIT
             elif databyte == 0x00 and self.state == INIT:
index 00bfb278ea41e0ce7bde91f30e17f1514c06d1f4..4ce6070ac6f2ff7971f2daa895e3769c2e834008 100644 (file)
@@ -52,7 +52,7 @@ class Decoder(srd.Decoder):
     ]
     options = {}
     annotations = [
     ]
     options = {}
     annotations = [
-        ['TODO', 'TODO'], 
+        ['TODO', 'TODO'],
     ]
 
     def __init__(self, **kwargs):
     ]
 
     def __init__(self, **kwargs):
@@ -205,7 +205,7 @@ class Decoder(srd.Decoder):
                 self.state = READ_RTC_REGS2
                 return
             else:
                 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)
         elif self.state == READ_RTC_REGS2:
             if cmd == 'DATA READ':
                 handle_reg = getattr(self, 'handle_reg_0x%02x' % self.reg)