mirror of
https://github.com/esphome/esphome.git
synced 2026-07-10 08:55:36 +00:00
[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:
@@ -1,5 +1,6 @@
|
||||
#ifdef USE_LIBRETINY
|
||||
|
||||
#include "core.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "preferences.h"
|
||||
|
||||
|
||||
@@ -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(); }
|
||||
|
||||
|
||||
Reference in New Issue
Block a user