Fixes for actual hardware

This commit is contained in:
Thomas Farstrike
2025-05-12 00:26:54 +02:00
parent 1f1a333172
commit 6a12af12de
3 changed files with 8 additions and 5 deletions
+6 -4
View File
@@ -11,6 +11,8 @@ import i2c
import lvgl as lv
import task_handler
import mpos.ui
# Pin configuration
SPI_BUS = 2
SPI_FREQ = 40000000
@@ -115,14 +117,14 @@ def handle_gesture(pin):
# Store the starting Y-coordinate
start_y = y
#print(f"Touch started at Y={start_y}")
elif gesture_id == 0x04 and drawer_open: # Swipe up
elif gesture_id == 0x04: # Swipe up
# print("Swipe Up Detected")
close_drawer()
mpos.ui.close_drawer()
start_y = None # Clear start_y after gesture
elif gesture_id == 0x03: # Swipe down
if start_y is not None and start_y <= NOTIFICATION_BAR_HEIGHT:
if start_y is not None and start_y <= mpos.ui.NOTIFICATION_BAR_HEIGHT:
# print("Swipe Down Detected from Notification Bar")
open_drawer()
mpos.ui.open_drawer()
start_y = None # Clear start_y after gesture
elif gesture_id == 0x05: # Release
start_y = None # Clear start_y on release
+1
View File
@@ -133,6 +133,7 @@ def create_notification_bar():
can_check_temperature = False
try:
import esp32
can_check_temperature = True
except Exception as e:
print("Warning: can't check temperature sensor:", str(e))
+1 -1
View File
@@ -45,7 +45,7 @@ fi
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py fs cp -r builtin :/
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py fs cp -r lib :/
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py fs cp -r resources :/
~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py fs cp -r data :/
#~/sources/lvgl_micropython/lib/micropython/tools/mpremote/mpremote.py fs cp -r data :/
popd