From 47b998d7f52383123e2b7850564602564b416eda Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 24 Apr 2026 11:55:14 -0500 Subject: [PATCH] [core] Drop -O2 attribute hack in favor of inline HAL wrappers (will merge inline-micros-esp32 next) --- esphome/components/esp32/core.cpp | 3 +-- esphome/core/application.h | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/esphome/components/esp32/core.cpp b/esphome/components/esp32/core.cpp index 0e114d09338..1c631371836 100644 --- a/esphome/components/esp32/core.cpp +++ b/esphome/components/esp32/core.cpp @@ -84,8 +84,7 @@ static StaticTask_t loop_task_tcb; // NOLINT(cppcoreguidelines-avoid-non- static StackType_t loop_task_stack[ESPHOME_LOOP_TASK_STACK_SIZE]; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables) -void __attribute__((optimize("O2"))) // NOLINT(clang-diagnostic-unknown-attributes) -loop_task(void *pv_params) { +void loop_task(void *pv_params) { setup(); while (true) { App.loop(); diff --git a/esphome/core/application.h b/esphome/core/application.h index e55e86f69f2..55578897863 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -546,8 +546,7 @@ inline ESPHOME_ALWAYS_INLINE Application::ComponentPhaseGuard::ComponentPhaseGua this->app_.in_loop_ = true; } -// NOLINTNEXTLINE(clang-diagnostic-unknown-attributes) -inline void ESPHOME_ALWAYS_INLINE __attribute__((optimize("O2"))) Application::loop() { +inline void ESPHOME_ALWAYS_INLINE Application::loop() { #ifdef USE_RUNTIME_STATS // Capture the start of the active (non-sleeping) portion of this iteration. // Used to derive main-loop overhead = active time − Σ(component time) −