diff --git a/.gitignore b/.gitignore index 193750f9..7776977d 100644 --- a/.gitignore +++ b/.gitignore @@ -20,3 +20,5 @@ test/dependencies.lock test/sdkconfig sdkconfig.bak *.ignore + +/sdkconfig.local diff --git a/BUILDING.md b/BUILDING.md index 571aa359..ee64b088 100644 --- a/BUILDING.md +++ b/BUILDING.md @@ -72,3 +72,15 @@ If you get errors involving missing C++ includes, then you may need to edit your editor's LSP invocation to include `--query-driver=**`. You should then get proper LSP integration via clangd. + +# ESP-IDF configuration + +Espressif exposes a large collection of configuration options[1] for its +framework; you can use `idf.py menuconfig` to generate a custom `sdkconfig` +file, eg. to change the logging level. + +To avoid needing to select the same set of options every time you regenerate +the sdkconfig, you can also set some defaults in `sdkconfig.local`; this is not +tracked in git, and is ideal for local / per-checkout changes. + +1. https://docs.espressif.com/projects/esp-idf/en/release-v3.3/api-reference/kconfig.html diff --git a/CMakeLists.txt b/CMakeLists.txt index f9d1f72c..3f0db812 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,7 +5,12 @@ cmake_minimum_required(VERSION 3.16) include($ENV{PROJ_PATH}/tools/cmake/common.cmake) -set(SDKCONFIG_DEFAULTS "sdkconfig.common") +get_filename_component(_abs_curr_dir "." ABSOLUTE) +if (EXISTS ${_abs_curr_dir}/sdkconfig.local) + set(SDKCONFIG_DEFAULTS "sdkconfig.common;sdkconfig.local") +else() + set(SDKCONFIG_DEFAULTS "sdkconfig.common") +endif() # No exceptions in app builds (this is different in test builds). idf_build_set_property(COMPILE_OPTIONS "-DRESULT_DISABLE_EXCEPTIONS" APPEND)