diff --git a/boards/esp32_4M_2APP.json b/boards/esp32_4M_2APP.json index e9dc5635c..34e8248e6 100644 --- a/boards/esp32_4M_2APP.json +++ b/boards/esp32_4M_2APP.json @@ -25,13 +25,13 @@ "arduino", "espidf" ], - "name": "Espressif Generic ESP32 4M Flash, Tasmota 1856k Code/OTA, 320k FS", + "name": "Espressif Generic ESP32 4M Flash, Tasmota 2880k Code/OTA, 320k FS", "upload": { "arduino": { "flash_extra_images": [ [ "0x2E0000", - "tasmota32-minicustom.bin" + "variants/tasmota/tasmota32-minicustom.bin" ] ] }, diff --git a/pio-tools/copy_safemode.py b/pio-tools/copy_safemode.py new file mode 100644 index 000000000..1818eb028 --- /dev/null +++ b/pio-tools/copy_safemode.py @@ -0,0 +1,22 @@ +import os +import shutil +from os.path import join +from SCons.Script import DefaultEnvironment + +env = DefaultEnvironment() +platform = env.PioPlatform() + +FRAMEWORK_DIR = platform.get_package_dir("framework-arduinoespressif32") + +safemode_dir = join(env["PROJECT_DIR"], "safemode") +variants_dir = join(FRAMEWORK_DIR, "variants", "tasmota") + +if env["PIOPLATFORM"] == "espressif32": + if os.path.exists(safemode_dir): +# print("safemode.bin dir exists") + if os.path.exists(variants_dir): + print("") # dummy print +# print("variants/tasmota exists") +# os.remove(variants_dir) # todo PermissionError: [Errno 1] Operation not permitted: + else: + shutil.copytree(safemode_dir, variants_dir) diff --git a/platformio_override_sample.ini b/platformio_override_sample.ini index 35e0708e4..629f03e67 100644 --- a/platformio_override_sample.ini +++ b/platformio_override_sample.ini @@ -91,7 +91,7 @@ lib_extra_dirs = ${library.lib_extra_dirs} [env:tasmota32_base] ; *** Uncomment next lines ";" to enable development Tasmota Arduino version ESP32 ;platform = https://github.com/tasmota/platform-espressif32/releases/download/v2.0.3rc1/platform-espressif32-2.0.3new.zip -;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/822/framework-arduinoespressif32-v4.4_work-c4b83228a5.tar.gz +;platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/825/framework-arduinoespressif32-v4.4_work-c4b83228a5.tar.gz build_unflags = ${esp32_defaults.build_unflags} build_flags = ${esp32_defaults.build_flags} diff --git a/platformio_tasmota32.ini b/platformio_tasmota32.ini index 8c604f663..38f17ebd3 100644 --- a/platformio_tasmota32.ini +++ b/platformio_tasmota32.ini @@ -34,6 +34,7 @@ build_flags = ${esp_defaults.build_flags} -Wl,--wrap=panicHandler -Wl,--wrap=xt_unhandled_exception -Wl,--wrap=_Z11analogWritehi ; `analogWrite(unsigned char, int)` use the Tasmota version of analogWrite for deeper integration and phase control extra_scripts = pre:pio-tools/add_c_flags.py + pre:pio-tools/copy_safemode.py post:pio-tools/post_esp32.py ${esp_defaults.extra_scripts} diff --git a/safemode.bin/tasmota32-minicustom.bin b/safemode/tasmota32-minicustom.bin similarity index 100% rename from safemode.bin/tasmota32-minicustom.bin rename to safemode/tasmota32-minicustom.bin