clang-tidy flagged the forward decl in hal_esp8266.h because <user_interface.h>
also declares the function (when included via SDK headers). Both decls are
identical `extern "C"` so the redundancy is harmless; suppress the warning
on the hal_esp8266.h side.
These wrappers were one-line forwarders to platform primitives:
delayMicroseconds(us) -> delay_microseconds_safe(us)
arch_feed_wdt() -> system_soft_wdt_feed()
progmem_read_byte(p) -> pgm_read_byte(p)
progmem_read_ptr(p) -> pgm_read_ptr(p) cast
progmem_read_uint16(p) -> pgm_read_word(p)
Mark them __attribute__((always_inline)) inline in hal_esp8266.h so the
wrapper call/return is eliminated at every call site, and remove the
out-of-line definitions from components/esp8266/core.cpp.
The IRAM_ATTR previously on delayMicroseconds() was decorative — its
body calls delay_microseconds_safe() which lives in flash, so an IRAM
ISR caller already jumped from SRAM into flash. Inlining is no worse
than the prior code (same reasoning as the libretiny IRAM_ATTR note in
the parent commit's PR description).
The dispatcher hal.h now gates its delayMicroseconds/arch_feed_wdt
declarations behind #ifndef USE_ESP8266 so clang-tidy does not flag
them as redundant on top of the inline definitions.
Mirror the wake.{h,cpp} → wake/wake_<platform>.{h,cpp} decomposition
that PR #15978 did. After this change esphome/core/hal.h is a thin
dispatcher and each platform's HAL bits (IRAM_ATTR / PROGMEM macros,
in_isr_context(), the inline yield/delay/micros/millis/millis_64
wrappers, plus ESP8266's progmem_read_*) live in their own header
under esphome/core/hal/.
Scope is headers only — there is no esphome/core/hal.cpp today (every
out-of-line implementation lives in esphome/components/<platform>/core.cpp
alongside platform-specific concerns) so no new .cpp files are added
and no FILTER_SOURCE_FILES entries are needed in core/config.py.
recursive_sources=True on the core manifest already picks up the new
.h files automatically.
No public API moves, no symbol renames, no behavior change. Pure code
motion. The only observable difference is the dispatcher #errors when
no USE_* is set (today an unknown platform silently fell through to
the else branch with empty IRAM_ATTR/PROGMEM); this matches wake.h's
behavior.
Resolves conflict in esphome/components/esp8266/core.cpp per PR #15977 plan:
keep #15662's fast millis() accumulator and optimistic_yield delay() body;
drop the upstream wrappers for yield()/millis_64()/micros() since those
are now always-inlined in hal.h.