From 60567cb238f57bc3cd86db93e9d32d456d1efb17 Mon Sep 17 00:00:00 2001 From: Tuan PM Date: Fri, 2 Mar 2018 11:24:27 +0700 Subject: [PATCH] Add vTaskDelay in STATE_WAIT_TIMEOUT, resolve #27 --- include/mqtt_client.h | 4 ---- mqtt_client.c | 2 +- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/include/mqtt_client.h b/include/mqtt_client.h index e5b2e61..36530b5 100755 --- a/include/mqtt_client.h +++ b/include/mqtt_client.h @@ -48,10 +48,6 @@ typedef struct { typedef esp_mqtt_event_t* esp_mqtt_event_handle_t; - -/** - * \return True on connect success, false on error - */ typedef esp_err_t (* mqtt_event_callback_t)(esp_mqtt_event_handle_t event); diff --git a/mqtt_client.c b/mqtt_client.c index d6c7673..9c1599a 100644 --- a/mqtt_client.c +++ b/mqtt_client.c @@ -708,7 +708,7 @@ static void esp_mqtt_task(void *pv) client->reconnect_tick = platform_tick_get_ms(); ESP_LOGD(TAG, "Reconnecting..."); } - // wait for timeout then change state to INIT + vTaskDelay(client->wait_timeout_ms/2/portTICK_RATE_MS); break; } }