From 02661081be8f1d2c14d33fa0a760d70a57359ea9 Mon Sep 17 00:00:00 2001 From: Ivan Grokhotkov Date: Mon, 15 Aug 2022 23:27:26 +0200 Subject: [PATCH] nvs_flash: make nvs_flash_init usable for Linux target Since the partition API is now supported for Linux target builds, this function can now be used. --- components/nvs_flash/src/nvs_api.cpp | 4 ++-- components/nvs_flash/test_nvs_host/Makefile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/nvs_flash/src/nvs_api.cpp b/components/nvs_flash/src/nvs_api.cpp index 8d63c25469..6d7f546050 100644 --- a/components/nvs_flash/src/nvs_api.cpp +++ b/components/nvs_flash/src/nvs_api.cpp @@ -116,7 +116,7 @@ extern "C" esp_err_t nvs_flash_init_partition_ptr(const esp_partition_t *partiti return init_res; } -#ifndef LINUX_TARGET +#ifndef LINUX_HOST_LEGACY_TEST extern "C" esp_err_t nvs_flash_init_partition(const char *part_name) { esp_err_t lock_result = Lock::init(); @@ -239,7 +239,7 @@ extern "C" esp_err_t nvs_flash_erase(void) { return nvs_flash_erase_partition(NVS_DEFAULT_PART_NAME); } -#endif // ! LINUX_TARGET +#endif // LINUX_HOST_LEGACY_TEST extern "C" esp_err_t nvs_flash_deinit_partition(const char* partition_name) { diff --git a/components/nvs_flash/test_nvs_host/Makefile b/components/nvs_flash/test_nvs_host/Makefile index 10669bfb6f..60bd9e802a 100644 --- a/components/nvs_flash/test_nvs_host/Makefile +++ b/components/nvs_flash/test_nvs_host/Makefile @@ -39,8 +39,8 @@ COMPILER := gcc endif CPPFLAGS += -I../private_include -I../include -I../src -I../../esp_rom/include -I../../esp_rom/include/linux -I../../log/include -I./ -I../../esp_common/include -I../../esp32/include -I ../../mbedtls/mbedtls/include -I ../../spi_flash/include -I ../../hal/include -I ../../xtensa/include -I ../../../tools/catch -fprofile-arcs -ftest-coverage -g2 -ggdb -CFLAGS += -fprofile-arcs -ftest-coverage -DLINUX_TARGET -CXXFLAGS += -std=c++11 -Wall -Werror -DLINUX_TARGET +CFLAGS += -fprofile-arcs -ftest-coverage -DLINUX_TARGET -DLINUX_HOST_LEGACY_TEST +CXXFLAGS += -std=c++11 -Wall -Werror -DLINUX_TARGET -DLINUX_HOST_LEGACY_TEST LDFLAGS += -lstdc++ -Wall -fprofile-arcs -ftest-coverage ifeq ($(COMPILER),clang)