Merge pull request #3077 from adafruit/TheKitty-patch-7
Update Find_EDID_Values.py
This commit is contained in:
commit
e579992b2f
1 changed files with 37 additions and 31 deletions
|
|
@ -9,6 +9,8 @@ import board
|
||||||
import busio
|
import busio
|
||||||
|
|
||||||
def parse_established_timings(edid):
|
def parse_established_timings(edid):
|
||||||
|
# pylint: disable=redefined-outer-name
|
||||||
|
# pylint: disable=too-many-branches
|
||||||
"""Parse established timings from EDID bytes 35-37"""
|
"""Parse established timings from EDID bytes 35-37"""
|
||||||
modes = []
|
modes = []
|
||||||
|
|
||||||
|
|
@ -55,6 +57,7 @@ def parse_established_timings(edid):
|
||||||
return modes
|
return modes
|
||||||
|
|
||||||
def parse_standard_timings(edid):
|
def parse_standard_timings(edid):
|
||||||
|
# pylint: disable=redefined-outer-name
|
||||||
"""Parse standard timings from EDID bytes 38-53"""
|
"""Parse standard timings from EDID bytes 38-53"""
|
||||||
modes = []
|
modes = []
|
||||||
|
|
||||||
|
|
@ -90,7 +93,10 @@ def parse_standard_timings(edid):
|
||||||
return modes
|
return modes
|
||||||
|
|
||||||
def parse_detailed_timings(edid):
|
def parse_detailed_timings(edid):
|
||||||
|
# pylint: disable=redefined-outer-name
|
||||||
# pylint: disable=unused-variable
|
# pylint: disable=unused-variable
|
||||||
|
# pylint: disable=too-many-locals
|
||||||
|
|
||||||
"""Parse detailed timing descriptors from EDID bytes 54-125"""
|
"""Parse detailed timing descriptors from EDID bytes 54-125"""
|
||||||
modes = []
|
modes = []
|
||||||
|
|
||||||
|
|
@ -153,7 +159,7 @@ if not i2c.try_lock():
|
||||||
print("\nI2C Present")
|
print("\nI2C Present")
|
||||||
|
|
||||||
devices = i2c.scan()
|
devices = i2c.scan()
|
||||||
if not (0x50 in devices):
|
if not 0x50 in devices:
|
||||||
print("No device found at EDID address 0x50, is the monitor plugged in " +
|
print("No device found at EDID address 0x50, is the monitor plugged in " +
|
||||||
"& board power cycled?")
|
"& board power cycled?")
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
|
@ -163,7 +169,7 @@ device = 0x50
|
||||||
edid = bytearray(128)
|
edid = bytearray(128)
|
||||||
out = bytearray([0])
|
out = bytearray([0])
|
||||||
i2c.writeto_then_readfrom(device, out, edid)
|
i2c.writeto_then_readfrom(device, out, edid)
|
||||||
|
# pylint: disable=too-many-boolean-expressions
|
||||||
if edid[0] != 0x00 or edid[1] != 0xFF or edid[2] != 0xFF or \
|
if edid[0] != 0x00 or edid[1] != 0xFF or edid[2] != 0xFF or \
|
||||||
edid[3] != 0xFF or edid[4] != 0xFF or edid[5] != 0xFF or \
|
edid[3] != 0xFF or edid[4] != 0xFF or edid[5] != 0xFF or \
|
||||||
edid[6] != 0xFF or edid[7] != 0x00:
|
edid[6] != 0xFF or edid[7] != 0x00:
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue