J. Nick Koston da9c44d28d [esp8266] Bound the critical section in millis() accumulator
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.
2026-04-11 23:21:15 -10:00
2023-06-12 17:00:34 +12:00
2022-09-06 15:48:01 +12:00
2025-12-21 09:26:03 -05:00
2024-03-28 10:20:51 +13:00
2025-07-17 22:40:28 +12:00
2026-04-07 22:29:55 +00: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
594 MiB
Languages
C++ 55.8%
Python 43.6%
C 0.3%
JavaScript 0.2%