diff --git a/src/ArduinoIoTCloudTCP.cpp b/src/ArduinoIoTCloudTCP.cpp index e65da587e..4cac10c6d 100644 --- a/src/ArduinoIoTCloudTCP.cpp +++ b/src/ArduinoIoTCloudTCP.cpp @@ -37,6 +37,7 @@ # include # include "tls/utility/SHA256.h" # include +# include #endif #include "utility/ota/OTA.h" @@ -285,11 +286,10 @@ int ArduinoIoTCloudTCP::begin(bool const enable_watchdog, String brokerAddress, #if defined (ARDUINO_ARCH_SAMD) || defined (ARDUINO_ARCH_MBED) if (enable_watchdog) { watchdog_enable(); -#ifdef WIFI_HAS_FEED_WATCHDOG_FUNC +#if defined (WIFI_HAS_FEED_WATCHDOG_FUNC) || defined (ARDUINO_PORTENTA_H7_WIFI_HAS_FEED_WATCHDOG_FUNC) WiFi.setFeedWatchdogFunc(watchdog_reset); #endif } - #endif return 1; diff --git a/src/utility/ota/OTA-portenta-h7.cpp b/src/utility/ota/OTA-portenta-h7.cpp index 7c6a01eb9..52faf73f8 100644 --- a/src/utility/ota/OTA-portenta-h7.cpp +++ b/src/utility/ota/OTA-portenta-h7.cpp @@ -40,6 +40,10 @@ int portenta_h7_onOTARequest(char const * ota_url) /* Use 2nd partition of QSPI (1st partition contains WiFi firmware) */ Arduino_Portenta_OTA_QSPI ota_portenta_qspi(QSPI_FLASH_FATFS_MBR, 2); +#if defined (ARDUINO_PORTENTA_OTA_HAS_WATCHDOG_FEED) + ota_portenta_qspi.setFeedWatchdogFunc(watchdog_reset); +#endif + watchdog_reset(); /* Initialize the QSPI memory for OTA handling. */