mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-01 19:54:32 +02:00
Merge branch 'bugfix/nvs_correct_namespaces' into 'master'
NVS: put wild functions into namespace See merge request espressif/esp-idf!10514
This commit is contained in:
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
namespace nvs {
|
namespace nvs {
|
||||||
|
|
||||||
|
namespace partition_lookup {
|
||||||
|
|
||||||
esp_err_t lookup_nvs_partition(const char* label, NVSPartition **p)
|
esp_err_t lookup_nvs_partition(const char* label, NVSPartition **p)
|
||||||
{
|
{
|
||||||
const esp_partition_t* esp_partition = esp_partition_find_first(
|
const esp_partition_t* esp_partition = esp_partition_find_first(
|
||||||
@@ -62,4 +64,6 @@ esp_err_t lookup_nvs_encrypted_partition(const char* label, nvs_sec_cfg_t* cfg,
|
|||||||
|
|
||||||
#endif // CONFIG_NVS_ENCRYPTION
|
#endif // CONFIG_NVS_ENCRYPTION
|
||||||
|
|
||||||
|
} // partition_lookup
|
||||||
|
|
||||||
} // nvs
|
} // nvs
|
||||||
|
@@ -7,12 +7,16 @@
|
|||||||
|
|
||||||
namespace nvs {
|
namespace nvs {
|
||||||
|
|
||||||
|
namespace partition_lookup {
|
||||||
|
|
||||||
esp_err_t lookup_nvs_partition(const char* label, NVSPartition **p);
|
esp_err_t lookup_nvs_partition(const char* label, NVSPartition **p);
|
||||||
|
|
||||||
#ifdef CONFIG_NVS_ENCRYPTION
|
#ifdef CONFIG_NVS_ENCRYPTION
|
||||||
esp_err_t lookup_nvs_encrypted_partition(const char* label, nvs_sec_cfg_t* cfg, NVSPartition **p);
|
esp_err_t lookup_nvs_encrypted_partition(const char* label, nvs_sec_cfg_t* cfg, NVSPartition **p);
|
||||||
#endif // CONFIG_NVS_ENCRYPTION
|
#endif // CONFIG_NVS_ENCRYPTION
|
||||||
|
|
||||||
|
} // partition_lookup
|
||||||
|
|
||||||
} // nvs
|
} // nvs
|
||||||
|
|
||||||
#endif // NVS_PARTITION_LOOKUP_HPP_
|
#endif // NVS_PARTITION_LOOKUP_HPP_
|
||||||
|
@@ -50,7 +50,7 @@ esp_err_t NVSPartitionManager::init_partition(const char *partition_label)
|
|||||||
assert(SPI_FLASH_SEC_SIZE != 0);
|
assert(SPI_FLASH_SEC_SIZE != 0);
|
||||||
|
|
||||||
NVSPartition *p = nullptr;
|
NVSPartition *p = nullptr;
|
||||||
esp_err_t result = lookup_nvs_partition(partition_label, &p);
|
esp_err_t result = partition_lookup::lookup_nvs_partition(partition_label, &p);
|
||||||
|
|
||||||
if (result != ESP_OK) {
|
if (result != ESP_OK) {
|
||||||
goto error;
|
goto error;
|
||||||
@@ -125,9 +125,9 @@ esp_err_t NVSPartitionManager::secure_init_partition(const char *part_name, nvs_
|
|||||||
NVSPartition *p;
|
NVSPartition *p;
|
||||||
esp_err_t result;
|
esp_err_t result;
|
||||||
if (cfg != nullptr) {
|
if (cfg != nullptr) {
|
||||||
result = lookup_nvs_encrypted_partition(part_name, cfg, &p);
|
result = partition_lookup::lookup_nvs_encrypted_partition(part_name, cfg, &p);
|
||||||
} else {
|
} else {
|
||||||
result = lookup_nvs_partition(part_name, &p);
|
result = partition_lookup::lookup_nvs_partition(part_name, &p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (result != ESP_OK) {
|
if (result != ESP_OK) {
|
||||||
|
Reference in New Issue
Block a user