[core] Add millis_64() HAL function with native ESP32 implementation (#14339)

This commit is contained in:
J. Nick Koston
2026-02-27 07:48:21 -10:00
committed by GitHub
parent 72ca514cc2
commit 1c7f769ec7
12 changed files with 66 additions and 27 deletions
+2
View File
@@ -1,5 +1,6 @@
#ifdef USE_HOST
#include "esphome/core/application.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
#include "preferences.h"
@@ -19,6 +20,7 @@ uint32_t IRAM_ATTR HOT millis() {
uint32_t ms = round(spec.tv_nsec / 1e6);
return ((uint32_t) seconds) * 1000U + ms;
}
uint64_t millis_64() { return App.scheduler.millis_64_impl_(millis()); }
void HOT delay(uint32_t ms) {
struct timespec ts;
ts.tv_sec = ms / 1000;