Fix crash/reboot: remove conflicting TinyUSB core sources from Adafruit lib instead of allow-multiple-definition

This commit is contained in:
2026-06-23 23:23:40 +00:00
parent 9ea09d52fe
commit 8bbf572414
2 changed files with 21 additions and 15 deletions
+19 -1
View File
@@ -1,3 +1,21 @@
Import("env")
import os
env.Append(LINKFLAGS=["-Wl,--allow-multiple-definition"])
lib_path = os.path.join(
env.subst("$PROJECT_DIR"),
".pio", "libdeps", env.subst("$PIOENV"),
"Adafruit TinyUSB Library", "src"
)
conflicting = [
"tusb.c",
"common/tusb_fifo.c",
"device/usbd.c",
"device/usbd_control.c",
]
for f in conflicting:
path = os.path.join(lib_path, f)
if os.path.exists(path):
os.remove(path)
print(f"[extra_script] Removed {f} (provided by ESP32 core libarduino_tinyusb.a)")