One Tasmota Platformio Platform for all framework variants

This commit is contained in:
Jason2866 2022-09-24 12:05:00 +02:00 committed by GitHub
parent bec6e78c8d
commit 9688de0b33
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 18 additions and 28 deletions

View File

@ -22,6 +22,13 @@ Import("env")
env = DefaultEnvironment()
platform = env.PioPlatform()
board = env.BoardConfig()
extra_flags = board.get("build.extra_flags", "")
extra_flags = [element.replace("-D", " ") for element in extra_flags]
extra_flags = ''.join(extra_flags)
build_flags = env.GetProjectOption("build_flags")
build_flags = [element.replace("-D", " ") for element in build_flags]
build_flags = ''.join(build_flags)
from genericpath import exists
import os
@ -36,6 +43,13 @@ sys.path.append(join(platform.get_package_dir("tool-esptoolpy")))
import esptool
FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32")
if "CORE32SOLO1" in extra_flags or "FRAMEWORK_ARDUINO_SOLO1" in build_flags:
FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-solo1")
print ("Building with Solo1 framework")
elif "FRAMEWORK_ARDUINO_ITEAD" in build_flags:
FRAMEWORK_DIR = platform.get_package_dir("framework-arduino-ITEAD")
print ("Building with ITEAD framework")
variants_dir = join(FRAMEWORK_DIR, "variants", "tasmota")
def esp32_create_chip_string(chip):
@ -200,4 +214,4 @@ def esp32_create_combined_bin(source, target, env):
esptool.main(cmd)
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin)
env.AddPostAction("$BUILD_DIR/${PROGNAME}.bin", esp32_create_combined_bin)

View File

@ -40,20 +40,7 @@ extra_scripts = pre:pio-tools/add_c_flags.py
${esp_defaults.extra_scripts}
[core32]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.5/platform-espressif32-2.0.5.zip
platform_packages =
build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags}
[core32solo1]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.5/platform-espressif32-solo1-2.0.5.zip
platform_packages =
build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags}
[core32itead]
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.5/platform-espressif32-ITEAD-2.0.5.zip
platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.5.1/platform-espressif32-2.0.5.1.zip
platform_packages =
build_unflags = ${esp32_defaults.build_unflags}
build_flags = ${esp32_defaults.build_flags}

View File

@ -111,12 +111,8 @@ monitor_filters = esp32_exception_decoder
[env:tasmota32solo1-ocd]
build_type = debug
extends = env:tasmota32solo1
platform = ${core32solo1.platform}
platform_packages = ${core32solo1.platform_packages}
board = esp32_solo1_4M
debug_tool = esp-prog
upload_protocol = esp-prog
debug_init_break = tbreak setup
build_unflags = ${core32solo1.build_unflags}
build_flags = ${core32solo1.build_flags}
monitor_filters = esp32_exception_decoder

View File

@ -104,15 +104,10 @@ lib_extra_dirs = lib/libesp32, lib/lib_basic, lib/lib_ssl
[env:tasmota32solo1]
extends = env:tasmota32_base
board = esp32_solo1_4M
platform = ${core32solo1.platform}
platform_packages = ${core32solo1.platform_packages}
build_flags = ${core32solo1.build_flags} -DFIRMWARE_TASMOTA32
[env:tasmota32solo1-safeboot]
extends = env:tasmota32_base
board = esp32_solo1_4M
platform = ${core32solo1.platform}
platform_packages = ${core32solo1.platform_packages}
build_flags = ${env:tasmota32_base.build_flags} -DFIRMWARE_SAFEBOOT
lib_extra_dirs = lib/lib_ssl, lib/libesp32
lib_ignore =
@ -123,10 +118,9 @@ lib_ignore =
[env:tasmota32-zbbrdgpro]
extends = env:tasmota32_base
board = esp32_4M_FS
platform = ${core32itead.platform}
platform_packages = ${core32itead.platform_packages}
build_flags = ${env:tasmota32_base.build_flags}
-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
@ -137,10 +131,9 @@ lib_extra_dirs = lib/lib_basic, lib/lib_ssl, lib/libesp32
[env:tasmota32-nspanel]
extends = env:tasmota32_base
platform = ${core32itead.platform}
platform_packages = ${core32itead.platform_packages}
build_flags = ${env:tasmota32_base.build_flags}
-DFIRMWARE_NSPANEL
-DFRAMEWORK_ARDUINO_ITEAD
[env:tasmota32c3-safeboot]
extends = env:tasmota32_base