access display and framebuffer properties for values, format code.
This commit is contained in:
parent
9a34a9d5b0
commit
d774cd952e
1 changed files with 9 additions and 5 deletions
|
|
@ -79,6 +79,7 @@ def request_display_config(width, height):
|
|||
)
|
||||
supervisor.runtime.display = framebufferio.FramebufferDisplay(fb)
|
||||
|
||||
|
||||
def get_display_config():
|
||||
"""
|
||||
Get the current display size configuration.
|
||||
|
|
@ -87,12 +88,15 @@ def get_display_config():
|
|||
:return: height: The height of the display in pixels.
|
||||
:return: pixel_depth of the display in pixels
|
||||
"""
|
||||
|
||||
try:
|
||||
display = (picodvi.Framebuffer.width, picodvi.Framebuffer.height, picodvi.Framebuffer.color_depth)
|
||||
return display
|
||||
except ValueError as e:
|
||||
display = supervisor.runtime.display
|
||||
display_config = (display.width, display.height, display.framebuffer.color_depth)
|
||||
return display_config
|
||||
except ValueError:
|
||||
return (None, None, None)
|
||||
|
||||
|
||||
class Peripherals:
|
||||
"""Peripherals Helper Class for the FruitJam Library
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue