mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
udp_perf/tcp_perf examples: Erase NVS if no more free pages
Follows same pattern as other examples. Amendment to https://github.com/espressif/esp-idf/pull/1279
This commit is contained in:
parent
3b84c1e8fa
commit
05dd46cd72
@ -124,7 +124,13 @@ static void tcp_conn(void *pvParameters)
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
nvs_flash_init();
|
||||
esp_err_t ret = nvs_flash_init();
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES) {
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
ESP_ERROR_CHECK( ret );
|
||||
|
||||
#if EXAMPLE_ESP_WIFI_MODE_AP
|
||||
ESP_LOGI(TAG, "EXAMPLE_ESP_WIFI_MODE_AP");
|
||||
wifi_init_softap();
|
||||
|
@ -103,7 +103,13 @@ static void udp_conn(void *pvParameters)
|
||||
|
||||
void app_main(void)
|
||||
{
|
||||
nvs_flash_init();
|
||||
esp_err_t ret = nvs_flash_init();
|
||||
if (ret == ESP_ERR_NVS_NO_FREE_PAGES) {
|
||||
ESP_ERROR_CHECK(nvs_flash_erase());
|
||||
ret = nvs_flash_init();
|
||||
}
|
||||
ESP_ERROR_CHECK( ret );
|
||||
|
||||
#if EXAMPLE_ESP_WIFI_MODE_AP
|
||||
ESP_LOGI(TAG, "EXAMPLE_ESP_WIFI_MODE_AP");
|
||||
wifi_init_softap();
|
||||
|
Loading…
Reference in New Issue
Block a user