Skip to content

Commit d774cd9

Browse files
committed
access display and framebuffer properties for values, format code.
1 parent 9a34a9d commit d774cd9

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

adafruit_fruitjam/peripherals.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,19 +79,23 @@ def request_display_config(width, height):
7979
)
8080
supervisor.runtime.display = framebufferio.FramebufferDisplay(fb)
8181

82+
8283
def get_display_config():
8384
"""
84-
Get the current display size configuration.
85+
Get the current display size configuration.
8586
8687
:return: width: The width of the display in pixels.
8788
:return: height: The height of the display in pixels.
8889
:return: pixel_depth of the display in pixels
8990
"""
91+
9092
try:
91-
display = (picodvi.Framebuffer.width, picodvi.Framebuffer.height, picodvi.Framebuffer.color_depth)
92-
return display
93-
except ValueError as e:
94-
return (None, None, None)
93+
display = supervisor.runtime.display
94+
display_config = (display.width, display.height, display.framebuffer.color_depth)
95+
return display_config
96+
except ValueError:
97+
return (None, None, None)
98+
9599

96100
class Peripherals:
97101
"""Peripherals Helper Class for the FruitJam Library

0 commit comments

Comments
 (0)