From 535f6875a8e1d96a5ac56b7fd47ce213573d56c7 Mon Sep 17 00:00:00 2001 From: Thomas Watson Date: Sat, 7 Dec 2024 17:20:57 -0600 Subject: [PATCH] AP_HAL_ESP32: move generated sdkconfig to build folder Ensures it gets cleaned with `./waf clean`. Users will hopefully delete and not be confused by the old one as it will now show up as an untracked file. --- .gitignore | 4 ---- libraries/AP_HAL_ESP32/README.md | 2 +- libraries/AP_HAL_ESP32/targets/esp32/.gitignore | 2 -- libraries/AP_HAL_ESP32/targets/esp32/esp-idf/CMakeLists.txt | 5 +++-- libraries/AP_HAL_ESP32/targets/esp32s3/.gitignore | 2 -- .../AP_HAL_ESP32/targets/esp32s3/esp-idf/CMakeLists.txt | 3 ++- 6 files changed, 6 insertions(+), 12 deletions(-) delete mode 100644 libraries/AP_HAL_ESP32/targets/esp32/.gitignore delete mode 100644 libraries/AP_HAL_ESP32/targets/esp32s3/.gitignore diff --git a/.gitignore b/.gitignore index b3d5003c68..debfef06f0 100644 --- a/.gitignore +++ b/.gitignore @@ -171,7 +171,3 @@ ENV/ env.bak/ venv.bak/ autotest_result_*_junit.xml - -# Ignore ESP-IDF SDK defines -/libraries/AP_HAL_ESP32/targets/esp32/esp-idf/sdkconfig -/libraries/AP_HAL_ESP32/targets/esp32s3/esp-idf/sdkconfig diff --git a/libraries/AP_HAL_ESP32/README.md b/libraries/AP_HAL_ESP32/README.md index cfd829fcde..eda355171e 100644 --- a/libraries/AP_HAL_ESP32/README.md +++ b/libraries/AP_HAL_ESP32/README.md @@ -86,7 +86,7 @@ press [tab] then enter on the [exit] box to exit the app done. the 'sdkconfig' file in this folder should have been updated cd ../../../.. -If you want to make changes to sdkconfig (sdkconfig is in git ignore list) permanent and to commit them back in git, you should edit sdkconfig.defaults manually or to use ninja save-defconfig tool after menuconfig. +If you want to make changes to sdkconfig (sdkconfig is in the build dir) permanent and to commit them back in git, you should edit sdkconfig.defaults manually or use ninja save-defconfig tool after menuconfig and replace sdkconfig.defaults with defconfig. 5. Recommanded way to flash the firmware : ``` diff --git a/libraries/AP_HAL_ESP32/targets/esp32/.gitignore b/libraries/AP_HAL_ESP32/targets/esp32/.gitignore deleted file mode 100644 index ec58be2346..0000000000 --- a/libraries/AP_HAL_ESP32/targets/esp32/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/sdkconfig.old -/board.txt diff --git a/libraries/AP_HAL_ESP32/targets/esp32/esp-idf/CMakeLists.txt b/libraries/AP_HAL_ESP32/targets/esp32/esp-idf/CMakeLists.txt index 10cca76197..32b77dd94f 100644 --- a/libraries/AP_HAL_ESP32/targets/esp32/esp-idf/CMakeLists.txt +++ b/libraries/AP_HAL_ESP32/targets/esp32/esp-idf/CMakeLists.txt @@ -28,8 +28,9 @@ idf_build_process(esp32 esp_system esp_rom esp_timer - - SDKCONFIG ${CMAKE_CURRENT_LIST_DIR}/sdkconfig + + # treat sdkconfig as build product generated by the defaults + SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig SDKCONFIG_DEFAULTS ${CMAKE_CURRENT_LIST_DIR}/sdkconfig.defaults BUILD_DIR ${CMAKE_BINARY_DIR}) diff --git a/libraries/AP_HAL_ESP32/targets/esp32s3/.gitignore b/libraries/AP_HAL_ESP32/targets/esp32s3/.gitignore deleted file mode 100644 index ec58be2346..0000000000 --- a/libraries/AP_HAL_ESP32/targets/esp32s3/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -/sdkconfig.old -/board.txt diff --git a/libraries/AP_HAL_ESP32/targets/esp32s3/esp-idf/CMakeLists.txt b/libraries/AP_HAL_ESP32/targets/esp32s3/esp-idf/CMakeLists.txt index c00f753174..8a63d422c5 100644 --- a/libraries/AP_HAL_ESP32/targets/esp32s3/esp-idf/CMakeLists.txt +++ b/libraries/AP_HAL_ESP32/targets/esp32s3/esp-idf/CMakeLists.txt @@ -29,7 +29,8 @@ idf_build_process(esp32s3 esp_rom esp_timer - SDKCONFIG ${CMAKE_CURRENT_LIST_DIR}/sdkconfig + # treat sdkconfig as build product generated by the defaults + SDKCONFIG ${CMAKE_BINARY_DIR}/sdkconfig SDKCONFIG_DEFAULTS ${CMAKE_CURRENT_LIST_DIR}/sdkconfig.defaults BUILD_DIR ${CMAKE_BINARY_DIR} )