Skip to content

Commit 5ee73f7

Browse files
pennamaentinger
authored andcommitted
Add watchdog reset after each step of CloudTCP state machine to avoid unwanted resets
1 parent 679118c commit 5ee73f7

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/ArduinoIoTCloudTCP.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,16 @@ void ArduinoIoTCloudTCP::update()
320320
}
321321
_state = next_state;
322322

323+
/* This watchdog feed is actually needed only by the RP2040 CONNECT cause its
324+
* maximum watchdog window is 8388ms; despite this we feed it for all
325+
* supported ARCH to keep code aligned.
326+
*/
327+
#ifdef ARDUINO_ARCH_SAMD
328+
samd_watchdog_reset();
329+
#elif defined(ARDUINO_ARCH_MBED)
330+
mbed_watchdog_reset();
331+
#endif
332+
323333
/* Check for new data from the MQTT client. */
324334
if (_mqttClient.connected())
325335
_mqttClient.poll();

0 commit comments

Comments
 (0)