This commit is contained in:
2021-11-01 22:21:08 +01:00
parent 1930963d50
commit 6c79bf7fee
2 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
menu "ESP Config lib settings" menu "ESP Config lib settings"
choice LOG_LOCAL_LEVEL_CONFIG choice LOG_LOCAL_LEVEL_CONFIG
bool "go-e CONFIG log verbosity" bool "CONFIG log verbosity"
default LOG_LOCAL_LEVEL_CONFIG_INFO default LOG_LOCAL_LEVEL_CONFIG_INFO
help help
Specify how much output to compile into the binary. Specify how much output to compile into the binary.
@ -9,7 +9,7 @@ choice LOG_LOCAL_LEVEL_CONFIG
esp_log_level_set function. esp_log_level_set function.
Note that this setting limits which log statements 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 setting this to, say, "Warning" would mean that
changing log level to "Debug" at runtime will not changing log level to "Debug" at runtime will not
be possible. be possible.

View File

@ -11,7 +11,7 @@
#define INSTANTIATE_CONFIGMANAGER_TEMPLATES(Type) \ #define INSTANTIATE_CONFIGMANAGER_TEMPLATES(Type) \
namespace espconfig { \ namespace espconfig { \
template esp_err_t ConfigManager<Type>::init(); \ template esp_err_t ConfigManager<Type>::init(const char *ns); \
/* template bool ConfigManager<Type>::erase(); */ \ /* template bool ConfigManager<Type>::erase(); */ \
template ConfigStatusReturnType ConfigManager<Type>::reset(); \ template ConfigStatusReturnType ConfigManager<Type>::reset(); \
template ConfigWrapperInterface *ConfigManager<Type>::findConfigByKey(std::string_view key); \ template ConfigWrapperInterface *ConfigManager<Type>::findConfigByKey(std::string_view key); \
@ -23,7 +23,7 @@ constexpr const char * const TAG = "CONFIG";
} // namespace } // namespace
template<typename ConfigContainer> template<typename ConfigContainer>
esp_err_t ConfigManager<ConfigContainer>::init() esp_err_t ConfigManager<ConfigContainer>::init(const char *ns)
{ {
ESP_LOGD(TAG, "called"); ESP_LOGD(TAG, "called");
@ -89,7 +89,7 @@ esp_err_t ConfigManager<ConfigContainer>::init()
#endif #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)); 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) if (result != ESP_OK)
return result; return result;
@ -97,7 +97,7 @@ esp_err_t ConfigManager<ConfigContainer>::init()
#ifdef CONFIG_SEPARATE_FACTORY_NVS_PARTITION #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)); 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) if (result != ESP_OK)
return result; return result;