Skip to content

Commit 162049a

Browse files
committed
Fix watchdog trigger timer. Kick the watchdog each 10 seconds.
1 parent f55e1fc commit 162049a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/utility/spi_drv.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,12 +217,13 @@ void SpiDrv::waitForSlaveSign()
217217

218218
void SpiDrv::waitForSlaveReady(bool const feed_watchdog)
219219
{
220-
unsigned long const start = millis();
220+
unsigned long trigger_time = millis() + 10000;
221221
while (!waitSlaveReady())
222222
{
223223
if (feed_watchdog) {
224-
if ((millis() - start) < 10000) {
224+
if (static_cast<int32_t>(trigger_time - millis()) <=0) {
225225
WiFi.feedWatchdog();
226+
trigger_time = millis() + 10000;
226227
}
227228
}
228229
}

0 commit comments

Comments
 (0)