From 2fc6331c7bfe7c182a8b609b87e400ce50a462b5 Mon Sep 17 00:00:00 2001 From: Thomas Farstrike Date: Sat, 22 Nov 2025 11:05:15 +0100 Subject: [PATCH] main.py: also detect fri3d camp 2024 badge hardware --- internal_filesystem/lib/mpos/main.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/internal_filesystem/lib/mpos/main.py b/internal_filesystem/lib/mpos/main.py index 204ca0ad..d854b86e 100644 --- a/internal_filesystem/lib/mpos/main.py +++ b/internal_filesystem/lib/mpos/main.py @@ -13,14 +13,20 @@ import sys if sys.platform == "linux" or sys.platform == "darwin": # linux and macOS board = "linux" elif sys.platform == "esp32": - board = "fri3d_2024" # default fallback import machine from machine import Pin, I2C i2c0 = I2C(0, sda=machine.Pin(48), scl=machine.Pin(47)) if i2c0.scan() == [21, 107]: # touch screen and IMU board = "waveshare_esp32_s3_touch_lcd_2" + else: + i2c0 = I2C(0, sda=machine.Pin(9), scl=machine.Pin(18)) + if i2c0.scan() == [107]: # only IMU + board = "fri3d_2024" + else: + print("Unable to identify board, defaulting...") + board = "waveshare_esp32_s3_touch_lcd_2" # default fallback -print(f"Detected hardware {board}, initializing...") +print(f"Initializing {board} hardware") import mpos.info mpos.info.set_hardware_id(board) __import__(f"mpos.board.{board}")