From 6c79bf7feef9f3d809c56fd78ee69a6614ff5b14 Mon Sep 17 00:00:00 2001 From: 0xFEEDC0DE64 Date: Mon, 1 Nov 2021 22:21:08 +0100 Subject: [PATCH] Cleanups --- Kconfig.projbuild | 4 ++-- src/configmanager_priv.h | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 233b707..0130e3a 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -1,7 +1,7 @@ menu "ESP Config lib settings" choice LOG_LOCAL_LEVEL_CONFIG - bool "go-e CONFIG log verbosity" + bool "CONFIG log verbosity" default LOG_LOCAL_LEVEL_CONFIG_INFO help Specify how much output to compile into the binary. @@ -9,7 +9,7 @@ choice LOG_LOCAL_LEVEL_CONFIG esp_log_level_set function. Note that this setting limits which log statements - are compiled into the program in go-e sources. So + are compiled into the program in sources. So setting this to, say, "Warning" would mean that changing log level to "Debug" at runtime will not be possible. diff --git a/src/configmanager_priv.h b/src/configmanager_priv.h index 2fb5846..bf4c19d 100644 --- a/src/configmanager_priv.h +++ b/src/configmanager_priv.h @@ -11,7 +11,7 @@ #define INSTANTIATE_CONFIGMANAGER_TEMPLATES(Type) \ namespace espconfig { \ - template esp_err_t ConfigManager::init(); \ + template esp_err_t ConfigManager::init(const char *ns); \ /* template bool ConfigManager::erase(); */ \ template ConfigStatusReturnType ConfigManager::reset(); \ template ConfigWrapperInterface *ConfigManager::findConfigByKey(std::string_view key); \ @@ -23,7 +23,7 @@ constexpr const char * const TAG = "CONFIG"; } // namespace template -esp_err_t ConfigManager::init() +esp_err_t ConfigManager::init(const char *ns) { ESP_LOGD(TAG, "called"); @@ -89,7 +89,7 @@ esp_err_t ConfigManager::init() #endif { - const auto result = nvs_open_from_partition("nvs", "recharge", NVS_READWRITE, &nvs_handle_user); + const auto result = nvs_open_from_partition("nvs", ns, NVS_READWRITE, &nvs_handle_user); ESP_LOG_LEVEL_LOCAL((result == ESP_OK ? ESP_LOG_INFO : ESP_LOG_ERROR), TAG, "nvs_open() for user partition returned: %s", esp_err_to_name(result)); if (result != ESP_OK) return result; @@ -97,7 +97,7 @@ esp_err_t ConfigManager::init() #ifdef CONFIG_SEPARATE_FACTORY_NVS_PARTITION { - const auto result = nvs_open_from_partition("nvsFac", "recharge", NVS_READWRITE, &nvs_handle_factory); + const auto result = nvs_open_from_partition("nvsFac", ns, NVS_READWRITE, &nvs_handle_factory); ESP_LOG_LEVEL_LOCAL((result == ESP_OK ? ESP_LOG_INFO : ESP_LOG_ERROR), TAG, "nvs_open() for factory partition returned: %s", esp_err_to_name(result)); if (result != ESP_OK) return result;