From 14f0d0a03c25574490489f0ab9a7ecbd90dbc7ae Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sun, 16 Nov 2025 03:02:12 +0100 Subject: [PATCH] re-enable raw build flags checks for USB mode only checking CPPDEFINES sometimes misses the flag --- pio-scripts/conditional_usb_mode.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pio-scripts/conditional_usb_mode.py b/pio-scripts/conditional_usb_mode.py index e3a277bf..738a3afa 100644 --- a/pio-scripts/conditional_usb_mode.py +++ b/pio-scripts/conditional_usb_mode.py @@ -39,9 +39,9 @@ def has_cdc_on_boot_enabled(env): return True # # Check in raw build flags - results can be misleading, because this ignores build_unflags - # for flag in build_flags: - # if isinstance(flag, str) and 'ARDUINO_USB_CDC_ON_BOOT=1' in flag: - # return True + for flag in build_flags: + if isinstance(flag, str) and 'ARDUINO_USB_CDC_ON_BOOT=1' in flag: + return True return False @@ -61,9 +61,9 @@ def has_usb_mode_enabled(env): return True # Check in raw build flags - results can be misleading, because this ignores build_unflags - # for flag in build_flags: - # if isinstance(flag, str) and 'ARDUINO_USB_MODE=1' in flag: - # return True + for flag in build_flags: + if isinstance(flag, str) and 'ARDUINO_USB_MODE=1' in flag: + return True return False