Commit 82215071 authored by Stefan Haun's avatar Stefan Haun
Browse files

Only lock display when it's used

parent 83a19117
Pipeline #3505 failed with stages
in 44 seconds
...@@ -206,7 +206,6 @@ def draw_menu(disp, applist, pos, appcount, lineoffset): ...@@ -206,7 +206,6 @@ def draw_menu(disp, applist, pos, appcount, lineoffset):
def main(): def main():
create_folders() create_folders()
disp = display.open()
applist = list_apps() applist = list_apps()
numapps = len(applist) numapps = len(applist)
current = 0 current = 0
...@@ -215,6 +214,8 @@ def main(): ...@@ -215,6 +214,8 @@ def main():
timerstartscroll = 5 timerstartscroll = 5
timercountpopped = 0 timercountpopped = 0
for ev in button_events(10): for ev in button_events(10):
disp = display.open()
if numapps == 0: if numapps == 0:
disp.clear(color.COMMYELLOW) disp.clear(color.COMMYELLOW)
disp.print( disp.print(
...@@ -266,6 +267,8 @@ def main(): ...@@ -266,6 +267,8 @@ def main():
draw_menu(disp, applist, current, numapps, lineoffset) draw_menu(disp, applist, current, numapps, lineoffset)
disp.close()
if __name__ == "__main__": if __name__ == "__main__":
try: try:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment