From cbd54e47eb8ff5351b97f05cd8fbfde9dd850c65 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Wed, 29 Apr 2026 07:03:56 -0500 Subject: [PATCH] [libretiny] Address Copilot review on #16113 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - hal.cpp: include components/libretiny/core.h so the lt_* C API (lt_wdt_enable, lt_reboot, lt_gpio_recover) and the LT_GPIO_RECOVER macro are properly declared rather than relying on transitive includes. core.h pulls which is libretiny's umbrella header. - hal_libretiny.h: preserve the HOT attribute on arch_feed_wdt() — the out-of-line wrapper had it; the inline now uses __attribute__((hot, always_inline)) to keep the placement hint consistent with the other platforms. The arch_restart() noreturn concern is already covered by the dispatcher hal.h declaration ('void __attribute__((noreturn)) arch_restart();' is visible when the body is parsed). --- esphome/components/libretiny/hal.cpp | 1 + esphome/core/hal/hal_libretiny.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/esphome/components/libretiny/hal.cpp b/esphome/components/libretiny/hal.cpp index 64b8de8f86..4e94d5242b 100644 --- a/esphome/components/libretiny/hal.cpp +++ b/esphome/components/libretiny/hal.cpp @@ -1,5 +1,6 @@ #ifdef USE_LIBRETINY +#include "core.h" #include "esphome/core/hal.h" #include "preferences.h" diff --git a/esphome/core/hal/hal_libretiny.h b/esphome/core/hal/hal_libretiny.h index 2c8b45812a..e519698ce0 100644 --- a/esphome/core/hal/hal_libretiny.h +++ b/esphome/core/hal/hal_libretiny.h @@ -95,7 +95,7 @@ __attribute__((always_inline)) inline uint32_t millis() { return static_cast