put user code in charge of restarting connect process

This commit is contained in:
Morgan Allen 2018-09-21 23:23:11 -07:00
parent 2dc81950d4
commit e36daf874b

View file

@ -69,8 +69,6 @@ void loop(void *p) {
ESP_LOGI(TAG, "starting main loop"); ESP_LOGI(TAG, "starting main loop");
while(true) { while(true) {
vTaskDelay(5000 / portTICK_PERIOD_MS);
EventBits_t ev_bits = xEventGroupGetBits(wm_event_group); EventBits_t ev_bits = xEventGroupGetBits(wm_event_group);
if(ev_bits & WIFI_CONNECTED) { if(ev_bits & WIFI_CONNECTED) {
@ -81,6 +79,8 @@ void loop(void *p) {
vTaskDelay(10000 / portTICK_PERIOD_MS); vTaskDelay(10000 / portTICK_PERIOD_MS);
ESP_LOGI(TAG, "Attempting reconnect"); ESP_LOGI(TAG, "Attempting reconnect");
wifi_manager_connect();
} }
vTaskDelay(10000 / portTICK_PERIOD_MS); vTaskDelay(10000 / portTICK_PERIOD_MS);