add: Kconfig assert or errorcode option

add: private include header
add: macro encapsulation for assertion or error check
add: ESP_FAIL return code documentation in public headers
change: replaced all assertions by NVS_ASSERT_OR_RETURN macro
change: few internal function return values from void to esp_err_t
change: ESP_ERR_NVS_VALUE_TOO_LONG macro comment
This commit is contained in:
Matus Fabo
2022-04-08 15:06:30 +02:00
committed by Martin Vychodil
parent 1f6fad6f48
commit 58cca07104
21 changed files with 300 additions and 201 deletions
@@ -6,6 +6,7 @@
#include "esp_partition.h"
#include "nvs_partition_manager.hpp"
#include "nvs_partition_lookup.hpp"
#include "nvs_internal.h"
#ifdef CONFIG_NVS_ENCRYPTION
#include "nvs_encrypted_partition.hpp"
@@ -39,7 +40,7 @@ esp_err_t NVSPartitionManager::init_partition(const char *partition_label)
return ESP_OK;
}
assert(SPI_FLASH_SEC_SIZE != 0);
NVS_ASSERT_OR_RETURN(SPI_FLASH_SEC_SIZE != 0, ESP_FAIL);
NVSPartition *p = nullptr;
esp_err_t result = partition_lookup::lookup_nvs_partition(partition_label, &p);