mirror of
https://github.com/esphome/esphome.git
synced 2026-09-14 08:38:39 +00:00
da9c44d28dc5e247867e5a998d1a3c3e31e37698
Split the μs→ms conversion into two paths to keep the interrupt- disabled critical section bounded: - Common path (delta < 10 ms): while loop runs at most 10 iterations (~100 ns). This covers the normal hot-path case where millis() is called thousands of times per second. - Rare path (delta >= 10 ms): constant-time multiply-by-reciprocal via /1000 (compiled to __umulsidi3, ~2.5 μs). Only fires after a long block (WiFi scan, boot, component stall), where the extra latency is negligible relative to the block that caused it. Addresses the concern that a multi-second WiFi scan block could cause the unbounded while loop to hold interrupts for tens of microseconds.
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
594 MiB
Languages
C++
55.8%
Python
43.6%
C
0.3%
JavaScript
0.2%
