From 870dc728f1616d1bcc63620b202ffbd7dc029895 Mon Sep 17 00:00:00 2001 From: Frank <91616163+softhack007@users.noreply.github.com> Date: Sun, 16 Nov 2025 02:13:29 +0100 Subject: [PATCH] Disable raw build flags checks for USB mode Commented out raw build flags checks for USB mode. The results would be wrong, because raw build_flags ignore build_unflags. --- pio-scripts/conditional_usb_mode.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pio-scripts/conditional_usb_mode.py b/pio-scripts/conditional_usb_mode.py index 2d34126e..e3a277bf 100644 --- a/pio-scripts/conditional_usb_mode.py +++ b/pio-scripts/conditional_usb_mode.py @@ -38,10 +38,10 @@ def has_cdc_on_boot_enabled(env): if define[0] == 'ARDUINO_USB_CDC_ON_BOOT' and define[1] == '1': return True - # Check in raw build flags - for flag in build_flags: - if isinstance(flag, str) and 'ARDUINO_USB_CDC_ON_BOOT=1' in flag: - 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 return False @@ -60,10 +60,10 @@ def has_usb_mode_enabled(env): if define[0] == 'ARDUINO_USB_MODE' and define[1] == '1': return True - # Check in raw build flags - for flag in build_flags: - if isinstance(flag, str) and 'ARDUINO_USB_MODE=1' in flag: - 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 return False