Work on new canary method

This commit is contained in:
Thomas Farstrike
2025-04-28 11:29:42 +02:00
parent 3af040c4ae
commit dc6d7ca81e
2 changed files with 10 additions and 12 deletions
@@ -30,9 +30,11 @@
#i2c.writeto_mem(sensor_addr, reg_addr, bytes([reg_value]))
subwindow.clean()
canary = lv.obj(subwindow)
canary.add_flag(lv.obj.FLAG.HIDDEN)
myscreen = lv.screen_active()
#subwindow.clean()
#canary = lv.obj(subwindow)
#canary.add_flag(lv.obj.FLAG.HIDDEN)
#width = 480
#height = 320
@@ -127,13 +129,9 @@ try_capture()
import time
while myscreen == lv.screen_active():
try_capture()
time.sleep_ms(100) # Allow for the MicroPython REPL to still work
try:
while canary.is_valid():
try_capture()
time.sleep_ms(100) # Allow for the MicroPython REPL to still work
except lv.LvReferenceError: # triggers when the canary dies
print("Canary died, deinitializing camera...")
cam.deinit()
print("App backgrounded, deinitializing camera...")
cam.deinit()
+1 -1
View File
@@ -325,7 +325,7 @@ def execute_script(script_source, is_file, is_launcher):
print(f"Thread {thread_id}: script {compile_name} finished")
if prevscreen and not is_launcher:
print("/main.py: execute_script(): cleaning subwindow...")
subwindow.clean()
#subwindow.clean()
timer1.delete()
timer2.delete()
timer3.delete()