diff --git a/platformio_core_defs.ini b/platformio_core_defs.ini index f3ba255bfe..e4eb01d5d6 100644 --- a/platformio_core_defs.ini +++ b/platformio_core_defs.ini @@ -197,8 +197,7 @@ lib_extra_dirs = ; ESP_IDF 5.3.1 [core_esp32_IDF5_3_2__3_1_0_LittleFS] -platform = https://github.com/Jason2866/platform-espressif32.git#44cb91bd1171b854c5055aef91b3819913ff7f02 -;platform = https://github.com/Jason2866/platform-espressif32.git +platform = https://github.com/Jason2866/platform-espressif32.git platform_packages = framework-arduinoespressif32 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3203/framework-arduinoespressif32-all-release_v5.3-ddc10306.zip build_flags = -DESP32_STAGE -DESP_IDF_VERSION_MAJOR=5 diff --git a/platformio_esp32_solo1.ini b/platformio_esp32_solo1.ini index c0f56eed09..4da44943c8 100644 --- a/platformio_esp32_solo1.ini +++ b/platformio_esp32_solo1.ini @@ -2,13 +2,14 @@ ; IDF 5.3.1 [esp32_solo1_common_LittleFS] extends = esp32_base_idf5 -platform = https://github.com/Jason2866/platform-espressif32.git#44cb91bd1171b854c5055aef91b3819913ff7f02 -;platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 +board = esp32_solo1_4M +platform = https://github.com/Jason2866/platform-espressif32.git#Arduino/IDF53 platform_packages = framework-arduino-solo1 @ https://github.com/Jason2866/esp32-arduino-lib-builder/releases/download/3204/framework-arduinoespressif32-solo1-release_v5.3-ddc10306.zip build_flags = ${esp32_base_idf5.build_flags} -DFEATURE_ARDUINO_OTA=1 -DUSE_LITTLEFS -DCORE32SOLO1 +lib_ignore = ${esp32_base_idf5.lib_ignore} extra_scripts = ${esp32_base_idf5.extra_scripts} build_unflags = ${esp32_base_idf5.build_unflags} -fexceptions @@ -17,7 +18,6 @@ board_build.filesystem = littlefs [env:custom_ESP32solo1_4M316k_LittleFS_ETH] extends = esp32_solo1_common_LittleFS -board = esp32_solo1_4M build_flags = ${esp32_solo1_common_LittleFS.build_flags} -DPLUGIN_BUILD_CUSTOM -DFEATURE_ETHERNET=1 @@ -27,7 +27,6 @@ extra_scripts = ${esp32_solo1_common_LittleFS.extra_scripts} [env:normal_ESP32solo1_4M316k_LittleFS_ETH] extends = esp32_solo1_common_LittleFS -board = esp32_solo1_4M build_flags = ${esp32_solo1_common_LittleFS.build_flags} -DFEATURE_ETHERNET=1 lib_ignore = ${esp32_solo1_common_LittleFS.lib_ignore} @@ -36,14 +35,12 @@ lib_ignore = ${esp32_solo1_common_LittleFS.lib_ignore} [env:energy_ESP32solo1_4M316k_LittleFS_ETH] extends = esp32_solo1_common_LittleFS -board = esp32_solo1_4M build_flags = ${esp32_solo1_common_LittleFS.build_flags} -D PLUGIN_ENERGY_COLLECTION -DFEATURE_ETHERNET=1 [env:climate_ESP32solo1_4M316k_LittleFS_ETH] extends = esp32_solo1_common_LittleFS -board = esp32_solo1_4M build_flags = ${esp32_solo1_common_LittleFS.build_flags} -D PLUGIN_CLIMATE_COLLECTION -DFEATURE_ETHERNET=1 diff --git a/platformio_esp32c3_envs.ini b/platformio_esp32c3_envs.ini index 0ec6f357bb..4354f627bd 100644 --- a/platformio_esp32c3_envs.ini +++ b/platformio_esp32c3_envs.ini @@ -24,6 +24,7 @@ extra_scripts = ${esp32_base_idf5.extra_scripts} build_unflags = ${esp32_base_idf5.build_unflags} -fexceptions board_build.filesystem = littlefs +lib_ignore = ${esp32_base_idf5.lib_ignore} [env:custom_ESP32c3_4M316k_CDC] diff --git a/platformio_esp32s2_envs.ini b/platformio_esp32s2_envs.ini index 7a44d64f94..8279685e9b 100644 --- a/platformio_esp32s2_envs.ini +++ b/platformio_esp32s2_envs.ini @@ -25,6 +25,7 @@ extra_scripts = ${esp32_base_idf5.extra_scripts} build_unflags = ${esp32_base_idf5.build_unflags} -fexceptions board_build.filesystem = littlefs +lib_ignore = ${esp32_base_idf5.lib_ignore} [env:custom_ESP32s2_4M316k_CDC] diff --git a/tools/pio/generate-compiletime-defines.py b/tools/pio/generate-compiletime-defines.py index fbf1ae6677..e23076826b 100644 --- a/tools/pio/generate-compiletime-defines.py +++ b/tools/pio/generate-compiletime-defines.py @@ -90,36 +90,30 @@ def deduct_flags_from_pioenv(): print("\u001b[33m File System: \u001b[0m {}".format(fs_str)) -def gen_compiletime_defines(node): +def gen_compiletime_defines(): """ `node.name` - a name of File System Node `node.get_path()` - a relative path `node.get_abspath()` - an absolute path """ - # do not modify node if file name does not contain "CompiletimeDefines.cpp" - if "CompiletimeDefines.cpp" not in node.name: - return node - # now, we can override ANY SCons variables (CPPDEFINES, CCFLAGS, etc.,) for the specific file # pass SCons variables as extra keyword arguments to `env.Object()` function # p.s: run `pio run -t envdump` to see a list with SCons variables - defines = env["CPPDEFINES"] - defines.append(("SET_BUILD_BINARY_FILENAME", '\\"%s\\"' % create_binary_filename())) - defines.append(("SET_BOARD_NAME", '\\"%s\\"' % get_board_name())) - defines.append(("SET_BUILD_PLATFORM", '\\"%s\\"' % platform.platform())) - defines.append(("SET_BUILD_GIT_HEAD", '\\"%s\\"' % get_git_description())) - defines.append(("SET_BUILD_CDN_URL", '\\"%s\\"' % get_cdn_url_prefix())) - defines.append(("SET_BUILD_VERSION", compute_version_date())) - defines.append(("SET_BUILD_UNIXTIME", create_build_unixtime())) - defines.append(("SET_BUILD_TIME_RFC1123", '\\"%s\\"' % create_RFC1123_build_date())) - - return env.Object( - node, - CPPDEFINES=defines, - CCFLAGS=env["CCFLAGS"] - ) + defines = [ + "-DSET_BUILD_BINARY_FILENAME=\\\"{}\\\"".format(create_binary_filename()), + "-DSET_BOARD_NAME=\\\"{}\\\"".format(get_board_name()), + "-DSET_BUILD_PLATFORM=\\\"{}\\\"".format(platform.platform()), + "-DSET_BUILD_GIT_HEAD=\\\"{}\\\"".format(get_git_description()), + "-DSET_BUILD_CDN_URL=\\\"{}\\\"".format(get_cdn_url_prefix()), + "-DSET_BUILD_VERSION={}".format(compute_version_date()), + "-DSET_BUILD_UNIXTIME={}".format(create_build_unixtime()), + "-DSET_BUILD_TIME_RFC1123=\\\"{}\\\"".format(create_RFC1123_build_date()) + ] + + env.Append(CXXFLAGS=defines) + print("\u001b[32m Compile time defines \u001b[0m") deduct_flags_from_pioenv() @@ -143,5 +137,4 @@ def gen_compiletime_defines(node): if "esp32" in env.BoardConfig().get("build.core"): print("\u001b[33m memory_type: \u001b[0m {}".format(env.BoardConfig().get("build.arduino.memory_type", "-"))) - -env.AddBuildMiddleware(gen_compiletime_defines) +gen_compiletime_defines() diff --git a/tools/pio/pre_custom_esp32.py b/tools/pio/pre_custom_esp32.py index 0061629ce7..c43244b737 100644 --- a/tools/pio/pre_custom_esp32.py +++ b/tools/pio/pre_custom_esp32.py @@ -88,7 +88,7 @@ my_flags = env.ParseFlags(env['BUILD_FLAGS']) my_defines = my_flags.get("CPPDEFINES") -env.Append(BUILD_FLAGS=custom_defines) +env.Append(CXXFLAGS=custom_defines) #defines = {k: v for (k, v) in my_defines} print("\u001b[32m Custom PIO configuration check \u001b[0m") diff --git a/tools/pio/pre_custom_esp32_IR.py b/tools/pio/pre_custom_esp32_IR.py index 6bf934431e..07e1bff33f 100644 --- a/tools/pio/pre_custom_esp32_IR.py +++ b/tools/pio/pre_custom_esp32_IR.py @@ -85,7 +85,7 @@ my_flags = env.ParseFlags(env['BUILD_FLAGS']) my_defines = my_flags.get("CPPDEFINES") -env.Append(BUILD_FLAGS=custom_defines) +env.Append(CXXFLAGS=custom_defines) #defines = {k: v for (k, v) in my_defines} print("\u001b[32m Custom PIO configuration check \u001b[0m") diff --git a/tools/pio/pre_custom_esp32c2.py b/tools/pio/pre_custom_esp32c2.py index cc470b7179..bdf2556c82 100644 --- a/tools/pio/pre_custom_esp32c2.py +++ b/tools/pio/pre_custom_esp32c2.py @@ -84,7 +84,7 @@ my_flags = env.ParseFlags(env['BUILD_FLAGS']) my_defines = my_flags.get("CPPDEFINES") -env.Append(BUILD_FLAGS=custom_defines) +env.Append(CXXFLAGS=custom_defines) #defines = {k: v for (k, v) in my_defines} print("\u001b[32m Custom PIO configuration check \u001b[0m") diff --git a/tools/pio/pre_custom_esp32c6.py b/tools/pio/pre_custom_esp32c6.py index 17b0a96325..feb04e6ba3 100644 --- a/tools/pio/pre_custom_esp32c6.py +++ b/tools/pio/pre_custom_esp32c6.py @@ -86,7 +86,7 @@ my_flags = env.ParseFlags(env['BUILD_FLAGS']) my_defines = my_flags.get("CPPDEFINES") -env.Append(BUILD_FLAGS=custom_defines) +env.Append(CXXFLAGS=custom_defines) #defines = {k: v for (k, v) in my_defines} print("\u001b[32m Custom PIO configuration check \u001b[0m") diff --git a/tools/pio/pre_custom_esp82xx.py b/tools/pio/pre_custom_esp82xx.py index 39600161b1..1d1768bd3e 100644 --- a/tools/pio/pre_custom_esp82xx.py +++ b/tools/pio/pre_custom_esp82xx.py @@ -84,7 +84,7 @@ my_flags = env.ParseFlags(env['BUILD_FLAGS']) my_defines = my_flags.get("CPPDEFINES") -env.Append(BUILD_FLAGS=custom_defines) +env.Append(CXXFLAGS=custom_defines) #defines = {k: v for (k, v) in my_defines} print("\u001b[32m Custom PIO configuration check \u001b[0m") diff --git a/tools/pio/pre_custom_esp82xx_IR.py b/tools/pio/pre_custom_esp82xx_IR.py index 3e25564261..99cfa86bdc 100644 --- a/tools/pio/pre_custom_esp82xx_IR.py +++ b/tools/pio/pre_custom_esp82xx_IR.py @@ -72,7 +72,7 @@ my_flags = env.ParseFlags(env['BUILD_FLAGS']) my_defines = my_flags.get("CPPDEFINES") -env.Append(BUILD_FLAGS=custom_defines) +env.Append(CXXFLAGS=custom_defines) #defines = {k: v for (k, v) in my_defines} print("\u001b[32m Custom PIO configuration check \u001b[0m") diff --git a/tools/pio/pre_safeboot_esp32c2.py b/tools/pio/pre_safeboot_esp32c2.py index 429b279403..c696729c09 100644 --- a/tools/pio/pre_safeboot_esp32c2.py +++ b/tools/pio/pre_safeboot_esp32c2.py @@ -47,7 +47,7 @@ my_flags = env.ParseFlags(env['BUILD_FLAGS']) my_defines = my_flags.get("CPPDEFINES") -env.Append(BUILD_FLAGS=custom_defines) +env.Append(CXXFLAGS=custom_defines) #defines = {k: v for (k, v) in my_defines} print("\u001b[32m Custom PIO configuration check \u001b[0m")