Skip to content

Commit d3f7a0a

Browse files
valerosfpistm
authored andcommitted
Sync PlatformIO build script
Compile USBDevice library by default if USB is enabled Signed-off-by: Valerii Koval <valeros@users.noreply.github.com>
1 parent 2a7fc9f commit d3f7a0a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tools/platformio/platformio-build.py

+12
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ def process_usb_configuration(cpp_defines):
109109
]
110110
)
111111

112+
if any(
113+
d in env.Flatten(env.get("CPPDEFINES", []))
114+
for d in (
115+
"USBD_USE_CDC",
116+
"USBD_USE_HID_COMPOSITE",
117+
)
118+
):
119+
env.BuildSources(
120+
join("$BUILD_DIR", "USBDevice"),
121+
join(FRAMEWORK_DIR, "libraries", "USBDevice")
122+
)
123+
112124
if any(f in env["CPPDEFINES"] for f in ("USBD_USE_CDC", "USBD_USE_HID_COMPOSITE")):
113125
env.Append(CPPDEFINES=["HAL_PCD_MODULE_ENABLED"])
114126

0 commit comments

Comments
 (0)