From d787a26f418e3865311daa3e1dc57832b22c7aa6 Mon Sep 17 00:00:00 2001 From: Chen Wu Date: Tue, 8 Jan 2019 13:19:40 +0800 Subject: [PATCH] fix: mqtt recv cycle feed watchdog when cycle interval is 0 Send cycle and recv cycle share one mutex, For increasing mqtt thoughtput, set receive cycle to 0, mqtt recv cycle feed watchdog when cycle interval=0 --- components/mqtt/paho/MQTTClient-C/src/MQTTClient.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/components/mqtt/paho/MQTTClient-C/src/MQTTClient.c b/components/mqtt/paho/MQTTClient-C/src/MQTTClient.c index ba251d37..35e055e3 100644 --- a/components/mqtt/paho/MQTTClient-C/src/MQTTClient.c +++ b/components/mqtt/paho/MQTTClient-C/src/MQTTClient.c @@ -18,6 +18,7 @@ #include #include #include "esp_log.h" +#include "esp_task_wdt.h" #include "MQTTClient.h" static const char *TAG = "mc"; @@ -438,6 +439,10 @@ void MQTTRun(void *parm) while (1) { TimerCountdownMS(&timer, CONFIG_MQTT_RECV_CYCLE); /* Don't wait too long if no traffic is incoming */ +#if CONFIG_MQTT_RECV_CYCLE == 0 /* The smaller cycle, the greater throughput */ + esp_task_wdt_reset(); +#endif + #if defined(MQTT_TASK) MutexLock(&c->mutex); #endif