Delete Adafruit's generic dcd_dwc2.c so ESP32 core's patched DCD is used

This commit is contained in:
2026-06-23 23:33:51 +00:00
parent bb5f992ccb
commit 66592dc33e
+18
View File
@@ -1,3 +1,21 @@
Import("env") Import("env")
import os, sys
# Keep allow-multiple-definition for core TinyUSB symbol overlaps
env.Append(LINKFLAGS=["-Wl,--allow-multiple-definition"]) env.Append(LINKFLAGS=["-Wl,--allow-multiple-definition"])
# Delete the Adafruit library's generic DCD so we use the ESP32-specific
# one from libarduino_tinyusb.a (which has correct hardware init patches)
lib_path = os.path.join(
env.subst("$PROJECT_DIR"),
".pio", "libdeps", env.subst("$PIOENV"),
"Adafruit TinyUSB Library", "src"
)
dcd_path = os.path.join(lib_path, "portable", "synopsys", "dwc2", "dcd_dwc2.c")
if os.path.exists(dcd_path):
os.remove(dcd_path)
print("[extra_script] Removed generic dcd_dwc2.c (using ESP32 core's patched version)")
else:
print("[extra_script] dcd_dwc2.c not found at:", dcd_path)