Skip to content

Commit 97fe8cc

Browse files
committed
Reset the watchdog timer on each event callback
1 parent d589689 commit 97fe8cc

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/include/InternalTypes.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#if !CD_CI
2828
/// @brief For tesing
2929
#define PRIVATE private
30+
#include "esp_task_wdt.h" // For esp_task_wdt_reset()
3031
/// @brief For tesing
3132
#define PROTECTED protected
3233
#else
@@ -476,6 +477,9 @@ struct InternalEvent
476477
/**
477478
* @brief Subscribe to this event
478479
*
480+
* @note The subscribed callback may need to invoke
481+
* esp_task_wdt_reset()
482+
*
479483
* @param callback Event callback
480484
*/
481485
static void subscribe(Callback callback)
@@ -492,7 +496,12 @@ struct InternalEvent
492496
static void notify(_Args... __args)
493497
{
494498
for (auto callback : _callbacks)
499+
{
500+
#if !CD_CI
501+
esp_task_wdt_reset();
502+
#endif
495503
callback(std::forward<_Args>(__args)...);
504+
}
496505
}
497506

498507
private:

0 commit comments

Comments
 (0)