NVS: put wild functions into namespace

pull/5682/merge
Jakob Hasse 2020-09-18 15:38:40 +08:00
rodzic 8b1d39bf53
commit 0e118c6070
3 zmienionych plików z 11 dodań i 3 usunięć

Wyświetl plik

@ -7,6 +7,8 @@
namespace nvs {
namespace partition_lookup {
esp_err_t lookup_nvs_partition(const char* label, NVSPartition **p)
{
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
} // partition_lookup
} // nvs

Wyświetl plik

@ -7,12 +7,16 @@
namespace nvs {
namespace partition_lookup {
esp_err_t lookup_nvs_partition(const char* label, NVSPartition **p);
#ifdef CONFIG_NVS_ENCRYPTION
esp_err_t lookup_nvs_encrypted_partition(const char* label, nvs_sec_cfg_t* cfg, NVSPartition **p);
#endif // CONFIG_NVS_ENCRYPTION
} // partition_lookup
} // nvs
#endif // NVS_PARTITION_LOOKUP_HPP_

Wyświetl plik

@ -50,7 +50,7 @@ esp_err_t NVSPartitionManager::init_partition(const char *partition_label)
assert(SPI_FLASH_SEC_SIZE != 0);
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) {
goto error;
@ -125,9 +125,9 @@ esp_err_t NVSPartitionManager::secure_init_partition(const char *part_name, nvs_
NVSPartition *p;
esp_err_t result;
if (cfg != nullptr) {
result = lookup_nvs_encrypted_partition(part_name, cfg, &p);
result = partition_lookup::lookup_nvs_encrypted_partition(part_name, cfg, &p);
} else {
result = lookup_nvs_partition(part_name, &p);
result = partition_lookup::lookup_nvs_partition(part_name, &p);
}
if (result != ESP_OK) {