J. Nick Koston 5be4f746ba [esp32] Move HAL bodies from components/esp32/core.cpp into core/hal/
Per-platform follow-up to #15977.

Move out-of-line HAL bodies (millis(), arch_restart(), arch_get_cpu_freq_hz())
from components/esp32/core.cpp into a new esphome/core/hal/hal_esp32.cpp so
HAL implementation finally lives next to the HAL header.

Inline the trivial one-liners directly in hal_esp32.h:
  delayMicroseconds(us)        -> delay_microseconds_safe(us)
  arch_feed_wdt()              -> esp_task_wdt_reset()
  arch_get_cpu_cycle_count()   -> esp_cpu_get_cycle_count()

arch_init() stays in components/esp32/core.cpp because it uses
esp32::crash_handler_read_and_clear() from the component-private
crash_handler.h header — moving it would require an awkward layering
inversion of core/ -> components/esp32/.

config.py FILTER_SOURCE_FILES gains a hal/hal_esp32.cpp entry so only
ESP32 builds compile it (same pattern wake/wake_*.cpp uses).

Cross-platform decls of delayMicroseconds(), arch_feed_wdt(), and
arch_get_cpu_cycle_count() are dropped from the dispatcher hal.h and
moved into each per-platform header — that way subsequent per-platform
follow-up PRs (libretiny, rp2040, host, zephyr) only need to touch
their own platform header instead of accumulating gates in hal.h.
2026-04-29 05:46:56 -05:00
2023-06-12 17:00:34 +12:00
2022-09-06 15:48:01 +12:00
2024-03-28 10:20:51 +13:00
2025-07-17 22:40:28 +12:00
2025-12-08 14:37:45 -05:00
2026-04-09 11:28:48 +12:00
2025-07-17 22:40:28 +12:00
S
Description
ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
Readme Multiple Licenses
597 MiB
Languages
C++ 55.8%
Python 43.6%
C 0.3%
JavaScript 0.2%