nvs: allow nvs_flash_init to be called more than once

Also don’t assert in nvs_* functions if nvs_flash_init wasn’t called,
and make nvs_flash_init_custom an internal API for unit tests.
This commit is contained in:
Ivan Grokhotkov
2016-11-15 18:24:56 +08:00
parent 51021b06f8
commit 6e97936bac
7 changed files with 73 additions and 23 deletions

View File

@@ -25,16 +25,6 @@ extern "C" {
*/
esp_err_t nvs_flash_init(void);
/**
* @brief Initialize NVS flash storage with custom flash sector layout
* @note Make sure specified sectors don't fall within ranges occupied
* by other partitions.
* @param baseSector Flash sector (units of 4096 bytes) offset to start NVS
* @param sectorCount Length (in flash sectors) of NVS region
* @return ESP_OK if flash was successfully initialized
*/
esp_err_t nvs_flash_init_custom(uint32_t baseSector, uint32_t sectorCount);
#ifdef __cplusplus
}