From 12e99228d18c43d4b037ef698259ddcf2914894f Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Mon, 9 Feb 2026 16:40:30 +0100 Subject: [PATCH] matouch_esp32_s3_2_8_spi: boot button for back action --- .../lib/mpos/board/matouch_esp32_s3_2_8.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/internal_filesystem/lib/mpos/board/matouch_esp32_s3_2_8.py b/internal_filesystem/lib/mpos/board/matouch_esp32_s3_2_8.py index 679356ce..d9f37c5a 100644 --- a/internal_filesystem/lib/mpos/board/matouch_esp32_s3_2_8.py +++ b/internal_filesystem/lib/mpos/board/matouch_esp32_s3_2_8.py @@ -83,9 +83,20 @@ try: import mpos.indev.gt911 as gt911 touch_dev = i2c.I2C.Device(bus=i2c_bus, dev_id=gt911.I2C_ADDR, reg_bits=gt911.BITS) indev = gt911.GT911(touch_dev, reset_pin=1, interrupt_pin=40, debug=True) # remove debug because it's slower + from mpos import InputManager + InputManager.register_indev(indev) except Exception as e: print(f"Touch init got exception: {e}") +# IO0 Button interrupt handler +def io0_interrupt_handler(pin): + print("IO0 button pressed!") + from mpos import back_screen + back_screen() + +io0_pin = machine.Pin(0, machine.Pin.IN, machine.Pin.PULL_UP) +io0_pin.irq(trigger=machine.Pin.IRQ_FALLING, handler=io0_interrupt_handler) + # Initialize LVGL lv.init()