mirror of
https://github.com/esphome/esphome.git
synced 2024-12-22 13:34:54 +01:00
Copy esp32 custom partition files to build folder (#5919)
This commit is contained in:
parent
f1f8689462
commit
058c43e953
1 changed files with 18 additions and 15 deletions
|
@ -497,10 +497,11 @@ async def to_code(config):
|
||||||
add_idf_sdkconfig_option("CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0", False)
|
add_idf_sdkconfig_option("CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU0", False)
|
||||||
add_idf_sdkconfig_option("CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1", False)
|
add_idf_sdkconfig_option("CONFIG_ESP_TASK_WDT_CHECK_IDLE_TASK_CPU1", False)
|
||||||
|
|
||||||
|
cg.add_platformio_option("board_build.partitions", "partitions.csv")
|
||||||
if CONF_PARTITIONS in config:
|
if CONF_PARTITIONS in config:
|
||||||
cg.add_platformio_option("board_build.partitions", config[CONF_PARTITIONS])
|
add_extra_build_file(
|
||||||
else:
|
"partitions.csv", CORE.relative_config_path(config[CONF_PARTITIONS])
|
||||||
cg.add_platformio_option("board_build.partitions", "partitions.csv")
|
)
|
||||||
|
|
||||||
for name, value in conf[CONF_SDKCONFIG_OPTIONS].items():
|
for name, value in conf[CONF_SDKCONFIG_OPTIONS].items():
|
||||||
add_idf_sdkconfig_option(name, RawSdkconfigValue(value))
|
add_idf_sdkconfig_option(name, RawSdkconfigValue(value))
|
||||||
|
@ -639,20 +640,22 @@ def _write_sdkconfig():
|
||||||
# Called by writer.py
|
# Called by writer.py
|
||||||
def copy_files():
|
def copy_files():
|
||||||
if CORE.using_arduino:
|
if CORE.using_arduino:
|
||||||
write_file_if_changed(
|
if "partitions.csv" not in CORE.data[KEY_ESP32][KEY_EXTRA_BUILD_FILES]:
|
||||||
CORE.relative_build_path("partitions.csv"),
|
write_file_if_changed(
|
||||||
get_arduino_partition_csv(
|
CORE.relative_build_path("partitions.csv"),
|
||||||
CORE.platformio_options.get("board_upload.flash_size")
|
get_arduino_partition_csv(
|
||||||
),
|
CORE.platformio_options.get("board_upload.flash_size")
|
||||||
)
|
),
|
||||||
|
)
|
||||||
if CORE.using_esp_idf:
|
if CORE.using_esp_idf:
|
||||||
_write_sdkconfig()
|
_write_sdkconfig()
|
||||||
write_file_if_changed(
|
if "partitions.csv" not in CORE.data[KEY_ESP32][KEY_EXTRA_BUILD_FILES]:
|
||||||
CORE.relative_build_path("partitions.csv"),
|
write_file_if_changed(
|
||||||
get_idf_partition_csv(
|
CORE.relative_build_path("partitions.csv"),
|
||||||
CORE.platformio_options.get("board_upload.flash_size")
|
get_idf_partition_csv(
|
||||||
),
|
CORE.platformio_options.get("board_upload.flash_size")
|
||||||
)
|
),
|
||||||
|
)
|
||||||
# IDF build scripts look for version string to put in the build.
|
# IDF build scripts look for version string to put in the build.
|
||||||
# However, if the build path does not have an initialized git repo,
|
# However, if the build path does not have an initialized git repo,
|
||||||
# and no version.txt file exists, the CMake script fails for some setups.
|
# and no version.txt file exists, the CMake script fails for some setups.
|
||||||
|
|
Loading…
Reference in a new issue