From a0e59a1fdaf6d48ca43ec701451ad7972dcde13a Mon Sep 17 00:00:00 2001 From: Jason2866 <24528715+Jason2866@users.noreply.github.com> Date: Mon, 28 Oct 2024 15:39:46 +0100 Subject: [PATCH] add different frameworks --- builder/main.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/builder/main.py b/builder/main.py index 1550b7a9e..672c09846 100644 --- a/builder/main.py +++ b/builder/main.py @@ -25,16 +25,23 @@ env = DefaultEnvironment() platform = env.PioPlatform() config = env.GetProjectConfig() +extra_flags = ''.join([element.replace("-D", " ") for element in env.BoardConfig().get("build.extra_flags", "")]) +build_flags = ''.join([element.replace("-D", " ") for element in env.GetProjectOption("build_flags")]) +flag_custom_sdkonfig = False +if config.has_option("env:"+env["PIOENV"], "custom_sdkconfig"): + flag_custom_sdkonfig = True # # Helpers # -flag_custom_sdkonfig = False -if config.has_option("env:"+env["PIOENV"], "custom_sdkconfig"): - flag_custom_sdkonfig = True +if "CORE32SOLO1" in extra_flags or "FRAMEWORK_ARDUINO_SOLO1" in build_flags and flag_custom_sdkonfig is False: + FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-solo1") +elif "CORE32ITEAD" in extra_flags or "FRAMEWORK_ARDUINO_ITEAD" in build_flags and flag_custom_sdkonfig is False: + FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-ITEAD") +else: + FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") -FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") def BeforeUpload(target, source, env): upload_options = {}