From 039df94b1f26db4534ce3e3120d9183e81cb1143 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Nicol=C3=B2=20Caruso?= <niccolo.caruso@skywarder.eu>
Date: Fri, 24 Jan 2025 14:39:59 +0100
Subject: [PATCH] [WIZ5500, FIX] Fixed timeout was not checked
A timeout check was missing, therefore if no timeout was used, it skipped the loop
---
src/shared/drivers/WIZ5500/WIZ5500.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/shared/drivers/WIZ5500/WIZ5500.cpp b/src/shared/drivers/WIZ5500/WIZ5500.cpp
index 20e2dbd46..0afdcb453 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
--
GitLab