Skip to content

Commit

Permalink
Sync PlatformIO build script
Browse files Browse the repository at this point in the history
Compile USBDevice library by default if USB is enabled

Signed-off-by: Valerii Koval <[email protected]>
  • Loading branch information
valeros authored and fpistm committed Aug 19, 2024
1 parent 2a7fc9f commit d3f7a0a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tools/platformio/platformio-build.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,18 @@ def process_usb_configuration(cpp_defines):
]
)

if any(
d in env.Flatten(env.get("CPPDEFINES", []))
for d in (
"USBD_USE_CDC",
"USBD_USE_HID_COMPOSITE",
)
):
env.BuildSources(
join("$BUILD_DIR", "USBDevice"),
join(FRAMEWORK_DIR, "libraries", "USBDevice")
)

if any(f in env["CPPDEFINES"] for f in ("USBD_USE_CDC", "USBD_USE_HID_COMPOSITE")):
env.Append(CPPDEFINES=["HAL_PCD_MODULE_ENABLED"])

Expand Down

0 comments on commit d3f7a0a

Please sign in to comment.