[libretiny] Address Copilot review on #16113

- 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 <Arduino.h> 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).
This commit is contained in:
J. Nick Koston
2026-04-29 07:03:56 -05:00
parent 3ea715b8e4
commit cbd54e47eb
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -1,5 +1,6 @@
#ifdef USE_LIBRETINY
#include "core.h"
#include "esphome/core/hal.h"
#include "preferences.h"
+1 -1
View File
@@ -95,7 +95,7 @@ __attribute__((always_inline)) inline uint32_t millis() { return static_cast<uin
#endif
__attribute__((always_inline)) inline uint64_t millis_64() { return Millis64Impl::compute(millis()); }
__attribute__((always_inline)) inline void arch_feed_wdt() { lt_wdt_feed(); }
__attribute__((hot, always_inline)) inline void arch_feed_wdt() { lt_wdt_feed(); }
__attribute__((always_inline)) inline uint32_t arch_get_cpu_cycle_count() { return lt_cpu_get_cycle_count(); }
__attribute__((always_inline)) inline uint32_t arch_get_cpu_freq_hz() { return lt_cpu_get_freq(); }