28 lines
563 B
C
28 lines
563 B
C
#include "nvs_flash.h"
|
|
#include "esp_log.h"
|
|
#include "lwip/err.h"
|
|
#include "lwip/sys.h"
|
|
#include "wifi_connect.h"
|
|
|
|
#include "esp_system.h"
|
|
#include "esp_err.h"
|
|
|
|
static const char *TAG = "Main";
|
|
|
|
void app_main(void)
|
|
{
|
|
|
|
//Initialize NVS
|
|
esp_err_t 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);
|
|
|
|
ESP_LOGI(TAG, "ESP_WIFI_MODE_STA");
|
|
wifi_init_sta();
|
|
|
|
ESP_LOGI(TAG,"End of main");
|
|
}
|