Skip to content

Commit 2ceef67

Browse files
authored
Merge pull request #828 from mathoudebine/dev/allow-disable-reset-by-config
2 parents 3f4a909 + 674c16c commit 2ceef67

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

config.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,3 +69,9 @@ display:
6969
# Set to true to reverse display orientation (landscape <-> reverse landscape, portrait <-> reverse portrait)
7070
# Note: Display basic orientation (portrait or landscape) is defined by the theme you have selected
7171
DISPLAY_REVERSE: false
72+
73+
# Reset display on startup: true/false
74+
# By default, this program resets the display on startup, in case it is in a degraded state from previous runs.
75+
# This behavior causes the display to disconnect/reconnect, and the COM port to change.
76+
# On some displays (like rev. A) it can be an issue, in this case change the value to "false".
77+
RESET_ON_STARTUP: true

library/display.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,11 @@ def __init__(self):
9090

9191
def initialize_display(self):
9292
# Reset screen in case it was in an unstable state (screen is also cleared)
93-
self.lcd.Reset()
93+
# Can be disabled by config. option
94+
if config.CONFIG_DATA["display"].get("RESET_ON_STARTUP", False):
95+
self.lcd.Reset()
96+
else:
97+
logger.debug("RESET_ON_STARTUP is false: display will not be reset")
9498

9599
# Send initialization commands
96100
self.lcd.InitializeComm()

0 commit comments

Comments
 (0)