Files
loopy_midi_controller/extra_script.py
T

23 lines
820 B
Python

Import("env")
import os
# Keep allow-multiple-definition for core TinyUSB symbol overlaps
env.Append(LINKFLAGS=["-Wl,--allow-multiple-definition"])
# Delete the Adafruit library's generic DCD so the ESP32 core's
# patched version from libarduino_tinyusb.a is used instead.
# We provide stubs (src/dcd_stubs.c) for the few ISO/SOF functions
# the ESP32 core's older DCD doesn't implement.
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 dcd_dwc2.c (using ESP32 core DCD + project stubs)")
else:
print("[extra_script] dcd_dwc2.c not found at:", dcd_path)