Skip to content

Commit 2fc6331

Browse files
main.py: also detect fri3d camp 2024 badge hardware
1 parent 71fabfa commit 2fc6331

File tree

1 file changed

+8
-2
lines changed
  • internal_filesystem/lib/mpos

1 file changed

+8
-2
lines changed

internal_filesystem/lib/mpos/main.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,20 @@
1313
if sys.platform == "linux" or sys.platform == "darwin": # linux and macOS
1414
board = "linux"
1515
elif sys.platform == "esp32":
16-
board = "fri3d_2024" # default fallback
1716
import machine
1817
from machine import Pin, I2C
1918
i2c0 = I2C(0, sda=machine.Pin(48), scl=machine.Pin(47))
2019
if i2c0.scan() == [21, 107]: # touch screen and IMU
2120
board = "waveshare_esp32_s3_touch_lcd_2"
21+
else:
22+
i2c0 = I2C(0, sda=machine.Pin(9), scl=machine.Pin(18))
23+
if i2c0.scan() == [107]: # only IMU
24+
board = "fri3d_2024"
25+
else:
26+
print("Unable to identify board, defaulting...")
27+
board = "waveshare_esp32_s3_touch_lcd_2" # default fallback
2228

23-
print(f"Detected hardware {board}, initializing...")
29+
print(f"Initializing {board} hardware")
2430
import mpos.info
2531
mpos.info.set_hardware_id(board)
2632
__import__(f"mpos.board.{board}")

0 commit comments

Comments
 (0)