add nvs initialize

pull/8374/head
xiongweichao 2021-12-29 19:37:58 +08:00
rodzic df1f9ec26e
commit 6b576212d9
1 zmienionych plików z 9 dodań i 0 usunięć

Wyświetl plik

@ -11,6 +11,7 @@
#include "soc/lldesc.h"
#include "esp_private/gdma.h"
#include "hal/uhci_ll.h"
#include "nvs_flash.h"
#include "esp_bt.h"
#include "esp_log.h"
@ -253,6 +254,14 @@ void app_main(void)
{
esp_err_t ret;
/* Initialize NVS — it is used to store PHY calibration data */
ret = nvs_flash_init();
if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) {
ESP_ERROR_CHECK(nvs_flash_erase());
ret = nvs_flash_init();
}
ESP_ERROR_CHECK( ret );
uhci_uart_install();
esp_bt_controller_config_t bt_cfg = BT_CONTROLLER_INIT_CONFIG_DEFAULT();