]> sigrok.org Git - libsigrokdecode.git/commitdiff
edid: move PD docstring to __init__.py
authorBert Vermeulen <redacted>
Sun, 29 Jan 2012 19:13:43 +0000 (20:13 +0100)
committerBert Vermeulen <redacted>
Sun, 29 Jan 2012 19:14:50 +0000 (20:14 +0100)
also minor code cleanups

decoders/edid/__init__.py
decoders/edid/edid.py

index f14c462e5143fde11fc5ed9e6186c24ba175c467..d892e60ec1e038177756ffccc58ce9084ba1340b 100644 (file)
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
 ## Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
 ##
 
+'''
+EDID 1.3 structure decoder.
+
+The three-character vendor ID as specified in the EDID standard refers to
+a Plug and Play ID (PNPID). The list of PNPID assignments is done by Microsoft.
+More information is available on this page:
+
+    http://msdn.microsoft.com/en-us/windows/hardware/gg463195
+
+The 'pnpids.txt' file included with this protocol decoder is derived from
+the list of assignments downloadable from that page. It was retrieved in
+January 2012.
+
+More information on EDID is available here:
+
+    https://en.wikipedia.org/wiki/Extended_display_identification_data
+'''
+
 from .edid import *
 
 from .edid import *
 
index b3ca128f5bcbbd2be20bb88655b3de31f68221e5..b575f46adcc97537a94dd124eeeb72f4a61ff68b 100644 (file)
 ## along with this program; if not, see <http://www.gnu.org/licenses/>.
 ##
 
 ## along with this program; if not, see <http://www.gnu.org/licenses/>.
 ##
 
-'''
-EDID 1.3 structure decoder.
-
-Details:
-https://en.wikipedia.org/wiki/Extended_display_identification_data
-'''
-
 # TODO:
 #    - EDID < 1.3
 # TODO:
 #    - EDID < 1.3
+#    - add short annotations
 #    - Signal level standard field in basic display parameters block
 #    - Additional color point descriptors
 #    - Additional standard timing descriptors
 #    - Signal level standard field in basic display parameters block
 #    - Additional color point descriptors
 #    - Additional standard timing descriptors
@@ -34,6 +28,7 @@ https://en.wikipedia.org/wiki/Extended_display_identification_data
 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
@@ -45,7 +40,6 @@ OFF_DET_TIMING = 54
 OFF_NUM_EXT = 126
 OFF_CHECKSUM = 127
 
 OFF_NUM_EXT = 126
 OFF_CHECKSUM = 127
 
-
 # Pre-EDID established timing modes
 est_modes = [
     "720x400@70Hz",
 # Pre-EDID established timing modes
 est_modes = [
     "720x400@70Hz",
@@ -79,6 +73,7 @@ xy_ratio = [
 ANN_FIELDS = 0
 ANN_SECTIONS = 1
 
 ANN_FIELDS = 0
 ANN_SECTIONS = 1
 
+
 class Decoder(srd.Decoder):
     api_version = 1
     id = 'edid'
 class Decoder(srd.Decoder):
     api_version = 1
     id = 'edid'
@@ -161,7 +156,7 @@ class Decoder(srd.Decoder):
         self.put(self.sn[start][0], self.sn[end][1], self.out_ann, [ANN_FIELDS, [annotation]])
 
     def lookup_pnpid(self, pnpid):
         self.put(self.sn[start][0], self.sn[end][1], self.out_ann, [ANN_FIELDS, [annotation]])
 
     def lookup_pnpid(self, pnpid):
-        pnpid_file = os.path.dirname(__file__) + '/pnpids.txt'
+        pnpid_file = os.path.join(os.path.dirname(__file__), 'pnpids.txt')
         if os.path.exists(pnpid_file):
             for line in open(pnpid_file).readlines():
                 if line.find(pnpid + ';') == 0:
         if os.path.exists(pnpid_file):
             for line in open(pnpid_file).readlines():
                 if line.find(pnpid + ';') == 0:
@@ -461,7 +456,7 @@ class Decoder(srd.Decoder):
             if self.cache[i] != 0 and self.cache[i+1] != 0:
                 self.decode_detailed_timing(i)
             else:
             if self.cache[i] != 0 and self.cache[i+1] != 0:
                 self.decode_detailed_timing(i)
             else:
-                if self.cache[i+2] == 0 or self.cache[i+4] == 0 or True:
+                if self.cache[i+2] == 0 or self.cache[i+4] == 0:
                     self.decode_descriptor(i)
 
 
                     self.decode_descriptor(i)