mirror of
https://github.com/esphome/esphome.git
synced 2026-09-15 17:18:40 +00:00
5be4f746ba999cba55a8389ac8ef126c9f5f83cb
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.
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%
