diff --git a/rx_esp32/src/main.c b/rx_esp32/src/main.c index 9e43358..09060fa 100644 --- a/rx_esp32/src/main.c +++ b/rx_esp32/src/main.c @@ -5,6 +5,7 @@ #include "esp_log.h" #include "esp_wifi.h" #include "esp_event.h" +#include "esp_task_wdt.h" #include "../lib/cli/CLI/CLI.h" #include "../lib/cli/CMDList/CMDList.h" @@ -127,6 +128,14 @@ void wifiInit() } void app_main() { + // disable watchdog + ESP_ERROR_CHECK(esp_task_wdt_deinit()); + + // wait so I have time to open the serial monitor + for (unsigned long i=0; i < 100000; i++){ + printf("."); + } + /* Initialize NVS — it is used to store PHY calibration data */ esp_err_t ret = nvs_flash_init(); if (ret == ESP_ERR_NVS_NO_FREE_PAGES || ret == ESP_ERR_NVS_NEW_VERSION_FOUND) { @@ -137,6 +146,8 @@ void app_main() { printChipInfo(); + wifiInit(); + /* Waiting until either the connection is established (WIFI_CONNECTED_BIT) or connection failed for the maximum * number of re-tries (WIFI_FAIL_BIT). The bits are set by event_handler() (see above) */ EventBits_t bits = xEventGroupWaitBits(s_wifi_event_group, @@ -155,10 +166,9 @@ void app_main() { ESP_LOGE(TAG, "UNEXPECTED EVENT"); } - while(true) + // while(true) { ESP_LOGI(TAG, ":3"); - } // running = true;