Skip to content

Commit a275da5

Browse files
SPIDrv improved waitForSlaveReady function
changed deault behaviour for watchdog kick and added timeout as parameter
1 parent 89ca316 commit a275da5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/utility/spi_drv.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ void SpiDrv::waitForSlaveSign()
215215
while (!waitSlaveSign());
216216
}
217217

218-
void SpiDrv::waitForSlaveReady(bool const feed_watchdog)
218+
void SpiDrv::waitForSlaveReady(bool const feed_watchdog, int timeout)
219219
{
220220
unsigned long const start = millis();
221221
while (!waitSlaveReady())
222222
{
223223
if (feed_watchdog) {
224-
if ((millis() - start) < 10000) {
224+
if ((millis() - start) < timeout) {
225225
WiFi.feedWatchdog();
226226
}
227227
}

src/utility/spi_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ class SpiDrv
5959

6060
static char spiTransfer(volatile char data);
6161

62-
static void waitForSlaveReady(bool const feed_watchdog = false);
62+
static void waitForSlaveReady(bool const feed_watchdog = true, int timeout=6000);
6363

6464
//static int waitSpiChar(char waitChar, char* readChar);
6565

0 commit comments

Comments
 (0)