From bd82c83f3ab930d62e8b979e03a99fbe2ee5881f Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 4 Mar 2026 22:48:41 -1000 Subject: [PATCH] Simplify alarm failure fallback to delay(ms) --- esphome/components/socket/lwip_raw_tcp_impl.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/esphome/components/socket/lwip_raw_tcp_impl.cpp b/esphome/components/socket/lwip_raw_tcp_impl.cpp index 6deb3d2341a..e2545b8fa7b 100644 --- a/esphome/components/socket/lwip_raw_tcp_impl.cpp +++ b/esphome/components/socket/lwip_raw_tcp_impl.cpp @@ -80,11 +80,7 @@ void socket_delay(uint32_t ms) { // add_alarm_in_ms returns >0 on success, 0 if time already passed, <0 on error. alarm_id_t alarm = add_alarm_in_ms(ms, alarm_callback, nullptr, true); if (alarm <= 0) { - // Fallback: honor the requested delay even if the alarm could not be scheduled. - absolute_time_t deadline = make_timeout_time_ms(ms); - while (!s_socket_woke && !time_reached(deadline)) { - __wfe(); - } + delay(ms); return; } // Sleep until woken by either the timer alarm or socket_wake().