Skip to content

Commit 13f68fb

Browse files
authored
Make TinyUSB linking work automatically with PIO (#658)
1 parent 3071b3f commit 13f68fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tools/platformio-build.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,9 @@ def configure_usb_flags(cpp_defines):
159159
if "USE_TINYUSB" in cpp_defines:
160160
env.Append(CPPPATH=[os.path.join(
161161
FRAMEWORK_DIR, "libraries", "Adafruit_TinyUSB_Arduino", "src", "arduino")])
162+
# automatically build with lib_archive = no to make weak linking work, needed for TinyUSB
163+
env_section = "env:" + env["PIOENV"]
164+
platform.config.set(env_section, "lib_archive", False)
162165
elif "PIO_FRAMEWORK_ARDUINO_NO_USB" in cpp_defines:
163166
env.Append(
164167
CPPPATH=[os.path.join(FRAMEWORK_DIR, "tools", "libpico")],

0 commit comments

Comments
 (0)