Skip to content

Commit 8567a9a

Browse files
committed
Merge branch 'bugfix/mqtt_recv_feed_wdt' into 'master'
fix: mqtt recv cycle feed watchdog when cycle interval is 0 See merge request sdk/ESP8266_RTOS_SDK!705
2 parents 91c7c10 + d787a26 commit 8567a9a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

components/mqtt/paho/MQTTClient-C/src/MQTTClient.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <stdio.h>
1919
#include <string.h>
2020
#include "esp_log.h"
21+
#include "esp_task_wdt.h"
2122
#include "MQTTClient.h"
2223

2324
static const char *TAG = "mc";
@@ -438,6 +439,10 @@ void MQTTRun(void *parm)
438439
while (1) {
439440
TimerCountdownMS(&timer, CONFIG_MQTT_RECV_CYCLE); /* Don't wait too long if no traffic is incoming */
440441

442+
#if CONFIG_MQTT_RECV_CYCLE == 0 /* The smaller cycle, the greater throughput */
443+
esp_task_wdt_reset();
444+
#endif
445+
441446
#if defined(MQTT_TASK)
442447
MutexLock(&c->mutex);
443448
#endif

0 commit comments

Comments
 (0)