Skip to content

Commit 629f1ea

Browse files
committed
Provide API to configure watchdog feed function and feed it
1 parent d64ebc2 commit 629f1ea

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

libraries/WiFi/src/WiFi.cpp

+12
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,18 @@ unsigned long arduino::WiFiClass::getTime() {
314314
return 0;
315315
}
316316

317+
void arduino::WiFiClass::setFeedWatchdogFunc(voidPrtFuncPtr func)
318+
{
319+
_feed_watchdog_func = func;
320+
}
321+
322+
void arduino::WiFiClass::feedWatchdog()
323+
{
324+
if (_feed_watchdog_func)
325+
_feed_watchdog_func();
326+
}
327+
328+
317329
#if defined(COMPONENT_4343W)
318330

319331
#include "QSPIFBlockDevice.h"

libraries/WiFi/src/WiFi.h

+4
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,9 @@ class WiFiClass
296296

297297
NetworkInterface *getNetwork();
298298

299+
void setFeedWatchdogFunc(voidPrtFuncPtr func);
300+
void feedWatchdog();
301+
299302
private:
300303

301304
EMACInterface* _softAP = nullptr;
@@ -316,6 +319,7 @@ class WiFiClass
316319
bool isVisible(const char* ssid);
317320
arduino::IPAddress ipAddressFromSocketAddress(SocketAddress socketAddress);
318321
SocketAddress socketAddressFromIpAddress(arduino::IPAddress ip, uint16_t port);
322+
voidPrtFuncPtr _feed_watchdog_func = 0;
319323
};
320324

321325
}

0 commit comments

Comments
 (0)