#include #include "freertos/FreeRTOS.h" #include "freertos/task.h" #include "freertos/event_groups.h" #include "esp_system.h" #include "esp_wifi.h" #include "esp_event.h" #include "esp_log.h" #include "nvs_flash.h" #include "esp_sntp.h" #include "lwip/err.h" #include "lwip/sys.h" #include "wifi.h" #include "ntp.h" #include "uart2.h" void app_main(void) { static const char *TAG = "main"; ESP_LOGI(TAG, "Starting program"); //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, "Done nvs_flash_init"); ESP_LOGI(TAG, "Starting Tasks"); //initWifiTask(); //initNtpTask(); initUartTask(); while(1) { vTaskDelay(500/portTICK_PERIOD_MS); } }