diff --git a/src/shared/drivers/WIZ5500/WIZ5500.cpp b/src/shared/drivers/WIZ5500/WIZ5500.cpp index 20e2dbd461b987a9c7818e80c19c0b9e51082f89..0afdcb453e82fb97cd9a0d5238c2c435c0dbdcdc 100644 --- a/src/shared/drivers/WIZ5500/WIZ5500.cpp +++ b/src/shared/drivers/WIZ5500/WIZ5500.cpp @@ -486,7 +486,8 @@ int Wiz5500::waitForSocketIrq(miosix::Lock<miosix::FastMutex>& l, int sock_n, while (interrupt_service_thread == this_thread) { - if (Kernel::getOldTick() > start + timeout) + // In case of no timeout or expired timeout + if (timeout != -1 && Kernel::getOldTick() > start + timeout) break; // Run a single step of the ISR