connectcore-demo-example: fix HDMI video resolution read for ccmp devices

Signed-off-by: David Escalona <david.escalona@digi.com>
This commit is contained in:
David Escalona 2022-07-26 10:44:26 +02:00
parent 4e2f032267
commit be0c37a04e
1 changed files with 7 additions and 2 deletions

View File

@ -646,13 +646,18 @@ def get_video_resolution():
Returns:
String: Video resolution.
"""
res = read_file("/sys/class/drm/card0/card0-DPI-1/modes")
res = read_file("/sys/class/drm/card0/card0-HDMI-A-1/modes")
if res == NOT_AVAILABLE:
res = read_file("/sys/class/drm/card0/card0-DPI-1/modes")
if res == NOT_AVAILABLE:
res = read_file("/sys/class/graphics/fb0/modes")
if res == NOT_AVAILABLE:
return "-"
return res.splitlines()[0].split(":")[1].strip()
line = res.splitlines()[0]
if ":" in line:
line = line.split(":")[1]
return line.strip()
def is_dual_system():