From 5dc5e11dc98d65967d76b051f838f5c0b32a41d4 Mon Sep 17 00:00:00 2001 From: Staars Date: Sat, 29 Oct 2022 10:56:53 +0200 Subject: [PATCH] check for valid cdc config: board vs env --- pio-tools/post_esp32.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index 3ded90386..370934845 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -139,6 +139,11 @@ def esp32_create_combined_bin(source, target, env): firmware_name = env.subst("$BUILD_DIR/${PROGNAME}.bin") chip = env.get("BOARD_MCU") tasmota_platform = esp32_create_chip_string(chip) + + if "-DUSE_USB_CDC_CONSOLE" in env.BoardConfig().get("build.extra_flags") and "cdc" not in tasmota_platform: + tasmota_platform += "cdc" + print("WARNING: board definition uses CDC configuration, but environment name does not -> changing tasmota safeboot binary to:", tasmota_platform + "-safeboot.bin") + if not os.path.exists(variants_dir): os.makedirs(variants_dir) if("safeboot" in firmware_name):