phy_init: reduce the amount of hardwired logic, add coexist init

This commit is contained in:
Ivan Grokhotkov
2016-11-18 01:18:39 +08:00
parent 6d4ab76db2
commit 541b142654
8 changed files with 185 additions and 122 deletions
+7 -7
View File
@@ -62,6 +62,13 @@ extern "C" void nvs_dump()
s_nvs_storage.debugDump();
}
extern "C" esp_err_t nvs_flash_init_custom(uint32_t baseSector, uint32_t sectorCount)
{
ESP_LOGD(TAG, "nvs_flash_init_custom start=%d count=%d", baseSector, sectorCount);
s_nvs_handles.clear();
return s_nvs_storage.init(baseSector, sectorCount);
}
#ifdef ESP_PLATFORM
extern "C" esp_err_t nvs_flash_init(void)
{
@@ -81,13 +88,6 @@ extern "C" esp_err_t nvs_flash_init(void)
}
#endif
extern "C" esp_err_t nvs_flash_init_custom(uint32_t baseSector, uint32_t sectorCount)
{
ESP_LOGD(TAG, "nvs_flash_init_custom start=%d count=%d", baseSector, sectorCount);
s_nvs_handles.clear();
return s_nvs_storage.init(baseSector, sectorCount);
}
static esp_err_t nvs_find_ns_handle(nvs_handle handle, HandleEntry& entry)
{
auto it = find_if(begin(s_nvs_handles), end(s_nvs_handles), [=](HandleEntry& e) -> bool {