Skip to content

Commit

Permalink
Back to three esp32x frameworks... (arendst#22351)
Browse files Browse the repository at this point in the history
* add special frameworks
* Update PULL_REQUEST_TEMPLATE.md
  • Loading branch information
Jason2866 authored Oct 23, 2024
1 parent 7f6dbfb commit 73897ef
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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**_
32 changes: 27 additions & 5 deletions pio-tools/post_esp32.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,30 @@
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:
Expand Down Expand Up @@ -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"):
Expand Down
2 changes: 1 addition & 1 deletion platformio_tasmota32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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}
10 changes: 3 additions & 7 deletions platformio_tasmota_env32.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 73897ef

Please sign in to comment.