diff --git a/src/utility/spi_drv.cpp b/src/utility/spi_drv.cpp index 2673112..9640e0e 100644 --- a/src/utility/spi_drv.cpp +++ b/src/utility/spi_drv.cpp @@ -215,13 +215,13 @@ void SpiDrv::waitForSlaveSign() while (!waitSlaveSign()); } -void SpiDrv::waitForSlaveReady(bool const feed_watchdog) +void SpiDrv::waitForSlaveReady(bool const feed_watchdog, int timeout) { unsigned long const start = millis(); while (!waitSlaveReady()) { if (feed_watchdog) { - if ((millis() - start) < 10000) { + if ((millis() - start) < timeout) { WiFi.feedWatchdog(); } } diff --git a/src/utility/spi_drv.h b/src/utility/spi_drv.h index fe8ee94..4b99dab 100644 --- a/src/utility/spi_drv.h +++ b/src/utility/spi_drv.h @@ -59,7 +59,7 @@ class SpiDrv static char spiTransfer(volatile char data); - static void waitForSlaveReady(bool const feed_watchdog = false); + static void waitForSlaveReady(bool const feed_watchdog = true, int timeout=6000); //static int waitSpiChar(char waitChar, char* readChar);