]> sigrok.org Git - libsigrokdecode.git/blobdiff - decoders/edid/edid.py
srd: Move all protocol docs to __init__.py files.
[libsigrokdecode.git] / decoders / edid / edid.py
index b575f46adcc97537a94dd124eeeb72f4a61ff68b..78ea4f6767adacf67de09d0226fe220f15ea671c 100644 (file)
@@ -17,6 +17,8 @@
 ## along with this program; if not, see <http://www.gnu.org/licenses/>.
 ##
 
+# EDID protocol decoder
+
 # TODO:
 #    - EDID < 1.3
 #    - add short annotations
@@ -107,6 +109,8 @@ class Decoder(srd.Decoder):
         self.cnt += 1
         self.sn.append( [ss, es] )
         self.cache.append(data)
+        # debug
+#        self.put(ss, es, self.out_ann, [0, ["%d: [%.2x]" % (self.cnt, data)]])
 
         if self.state is None:
             # Wait for the EDID header
@@ -115,6 +119,7 @@ class Decoder(srd.Decoder):
                     # Throw away any garbage before the header
                     self.sn = self.sn[-8:]
                     self.cache = self.cache[-8:]
+                    self.cnt = 8
                     self.state = 'edid'
                     self.put(ss, es, self.out_ann, [0, ["EDID header"]])
         elif self.state == 'edid':
@@ -401,7 +406,7 @@ class Decoder(srd.Decoder):
                     + (posneg[sync2 & 0x01]) + ')'
         elif sync == 0x03:
             features += 'digital separate ('
-            features += 'Vsync polarity ' + (posneg[sync2 >> 1])
+            features += 'Vsync polarity ' + (posneg[(sync2 & 0x02) >> 1])
             features += ', Hsync polarity ' + (posneg[sync2 & 0x01])
             features += ')'
         features += ', '