#pragma once #include #include "esp_timer.h" /** * @brief Arduino-compatible millisecond counter. * * The original firmware used the Arduino `millis()` helper; ESP-IDF offers the * same value through esp_timer. The result is truncated to 32 bits on purpose * so that the "elapsed = now - then" idiom keeps working across the wrap. */ inline uint32_t millis() { return static_cast(esp_timer_get_time() / 1000); }