diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index e8df939fe..4d1fe4601 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -7,7 +7,7 @@ - [ ] Only relevant files were touched - [ ] Only one feature/fix was added per PR and the code change compiles without warnings - [ ] The code change is tested and works with Tasmota core ESP8266 V.2.7.8 - - [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.0.241015 + - [ ] The code change is tested and works with Tasmota core ESP32 V.3.1.0.241023 - [ ] I accept the [CLA](https://github.com/arendst/Tasmota/blob/development/CONTRIBUTING.md#contributor-license-agreement-cla). _NOTE: The code change must pass CI tests. **Your PR cannot be merged unless tests pass**_ diff --git a/pio-tools/post_esp32.py b/pio-tools/post_esp32.py index f0af4322a..e296be29e 100644 --- a/pio-tools/post_esp32.py +++ b/pio-tools/post_esp32.py @@ -43,14 +43,30 @@ variant = env.BoardConfig().get("build.variant", "") sections = env.subst(env.get("FLASH_EXTRA_IMAGES")) chip = env.get("BOARD_MCU") mcu_build_variant = env.BoardConfig().get("build.variant", "").lower() -FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") # Copy safeboots firmwares in place when running in Github github_actions = os.getenv('GITHUB_ACTIONS') -if github_actions and os.path.exists("./firmware/firmware"): - shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduinoespressif32/variants/tasmota", dirs_exist_ok=True) - if variants_dir: - shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True) +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")]) + +if "CORE32SOLO1" in extra_flags or "FRAMEWORK_ARDUINO_SOLO1" in build_flags: + FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-solo1") + if github_actions and os.path.exists("./firmware/firmware"): + shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-solo1/variants/tasmota") + if variants_dir: + shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True) +elif "CORE32ITEAD" in extra_flags or "FRAMEWORK_ARDUINO_ITEAD" in build_flags: + FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-ITEAD") + if github_actions and os.path.exists("./firmware/firmware"): + shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduino-ITEAD/variants/tasmota") + if variants_dir: + shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True) +else: + FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") + if github_actions and os.path.exists("./firmware/firmware"): + shutil.copytree("./firmware/firmware", "/home/runner/.platformio/packages/framework-arduinoespressif32/variants/tasmota") + if variants_dir: + shutil.copytree("./firmware/firmware", variants_dir, dirs_exist_ok=True) # Copy pins_arduino.h to variants folder if variants_dir: @@ -113,6 +129,12 @@ def patch_partitions_bin(size_string): def esp32_create_chip_string(chip): tasmota_platform_org = env.subst("$BUILD_DIR").split(os.path.sep)[-1] tasmota_platform = tasmota_platform_org.split('-')[0] + if ("CORE32SOLO1" in extra_flags or "FRAMEWORK_ARDUINO_SOLO1" in build_flags) and "tasmota32-safeboot" not in tasmota_platform_org and "tasmota32solo1" not in tasmota_platform_org: + print(Fore.YELLOW + "Unexpected naming convention in this build environment:" + Fore.RED, tasmota_platform_org) + print(Fore.YELLOW + "Expected build environment name like " + Fore.GREEN + "'tasmota32solo1-whatever-you-want'") + print(Fore.YELLOW + "Please correct your actual build environment, to avoid undefined behavior in build process!!") + tasmota_platform = "tasmota32solo1" + return tasmota_platform if "tasmota" + chip[3:] not in tasmota_platform: # check + fix for a valid name like 'tasmota' + '32c3' tasmota_platform = "tasmota" + chip[3:] if "-DUSE_USB_CDC_CONSOLE" not in env.BoardConfig().get("build.extra_flags"): diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 15b19d401..9a5d99ef1 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -80,7 +80,7 @@ lib_ignore = ${esp32_defaults.lib_ignore} ccronexpr [core32] -platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.10.30/platform-espressif32.zip +platform = https://github.com/tasmota/platform-espressif32/releases/download/2024.10.31/platform-espressif32.zip platform_packages = build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} diff --git a/platformio_tasmota_env32.ini b/platformio_tasmota_env32.ini index f5dc5931a..5b6baa383 100644 --- a/platformio_tasmota_env32.ini +++ b/platformio_tasmota_env32.ini @@ -31,11 +31,11 @@ extends = env:tasmota32_base board = esp32-solo1 board_build.app_partition_name = safeboot build_flags = ${env:tasmota32_base.build_flags} + -DFRAMEWORK_ARDUINO_SOLO1 -DFIRMWARE_SAFEBOOT -DOTA_URL='"http://ota.tasmota.com/tasmota32/release/tasmota32-safeboot.bin"' lib_extra_dirs = lib/lib_ssl, lib/libesp32 lib_ignore = ${safeboot_flags.lib_ignore} -custom_sdkconfig = CONFIG_FREERTOS_UNICORE=y [env:tasmota32solo1-safeboot] extends = env:tasmota32_base @@ -46,7 +46,6 @@ build_flags = ${env:tasmota32_base.build_flags} -DOTA_URL='"http://ota.tasmota.com/tasmota32/release/tasmota32solo1-safeboot.bin"' lib_extra_dirs = lib/lib_ssl, lib/libesp32 lib_ignore = ${safeboot_flags.lib_ignore} -custom_sdkconfig = CONFIG_FREERTOS_UNICORE=y [env:tasmota32s2-safeboot] extends = env:tasmota32_base @@ -154,7 +153,6 @@ build_flags = ${env:tasmota32_base.build_flags} lib_ignore = ${env:tasmota32_base.lib_ignore} Micro-RTSP epdiy -custom_sdkconfig = CONFIG_FREERTOS_UNICORE=y [env:tasmota32s2] extends = env:tasmota32_base @@ -266,6 +264,7 @@ board_build.partitions = partitions/esp32_partition_app1856k_fs1344k.csv build_flags = ${env:tasmota32_base.build_flags} -DOTA_URL='"http://ota.tasmota.com/tasmota32/release/tasmota32-zbbrdgpro.bin"' -DFIRMWARE_ZBBRDGPRO + -DFRAMEWORK_ARDUINO_ITEAD custom_files_upload = ${env:tasmota32_base.custom_files_upload} tools/fw_SonoffZigbeeBridgePro_cc2652/Sonoff_ZBPro.autoconf tasmota/berry/zigbee/cc2652_flasher.be @@ -278,16 +277,13 @@ lib_ignore = ${env:tasmota32_base.lib_ignore} IRremoteESP8266 TasmotaModbus ESP Mail Client -custom_sdkconfig = CONFIG_D0WD_PSRAM_CLK_IO=5 - CONFIG_D0WD_PSRAM_CS_IO=18 [env:tasmota32-nspanel] extends = env:tasmota32_base build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_NSPANEL + -DFRAMEWORK_ARDUINO_ITEAD -DOTA_URL='"http://ota.tasmota.com/tasmota32/release/tasmota32-nspanel.bin"' -custom_sdkconfig = CONFIG_D0WD_PSRAM_CLK_IO=5 - CONFIG_D0WD_PSRAM_CS_IO=18 [env:tasmota32-AD] extends = env:tasmota32_base