From 9504e92458176808313087c7a0f85375fc3d33d5 Mon Sep 17 00:00:00 2001 From: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com> Date: Mon, 12 Jan 2026 18:06:41 -0500 Subject: [PATCH] [remote_transmitter] Fix ESP8266 timing by using busy loop (#13172) Co-authored-by: Claude --- .../components/remote_transmitter/remote_transmitter.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/esphome/components/remote_transmitter/remote_transmitter.cpp b/esphome/components/remote_transmitter/remote_transmitter.cpp index 576143bcbc..f20789fb9f 100644 --- a/esphome/components/remote_transmitter/remote_transmitter.cpp +++ b/esphome/components/remote_transmitter/remote_transmitter.cpp @@ -40,13 +40,10 @@ void RemoteTransmitterComponent::await_target_time_() { if (this->target_time_ == 0) { this->target_time_ = current_time; } else if ((int32_t) (this->target_time_ - current_time) > 0) { -#if defined(USE_LIBRETINY) || defined(USE_RP2040) - // busy loop is required for libretiny and rp2040 as interrupts are disabled + // busy loop is required as interrupts are disabled and delayMicroseconds() + // may not work correctly in interrupt-disabled contexts on all platforms while ((int32_t) (this->target_time_ - micros()) > 0) ; -#else - delayMicroseconds(this->target_time_ - current_time); -#endif } }