[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 -2
View File
@@ -385,7 +385,7 @@ json::SerializationBuffer<> WebServer::get_config_json() {
#endif
root[ESPHOME_F("log")] = this->expose_log_;
root[ESPHOME_F("lang")] = "en";
root[ESPHOME_F("uptime")] = static_cast<uint32_t>(App.scheduler.millis_64() / 1000);
root[ESPHOME_F("uptime")] = static_cast<uint32_t>(millis_64() / 1000);
return builder.serialize();
}
@@ -414,7 +414,7 @@ void WebServer::setup() {
// getting a lot of events
this->set_interval(10000, [this]() {
char buf[32];
auto uptime = static_cast<uint32_t>(App.scheduler.millis_64() / 1000);
auto uptime = static_cast<uint32_t>(millis_64() / 1000);
buf_append_printf(buf, sizeof(buf), 0, "{\"uptime\":%u}", uptime);
this->events_.try_send_nodefer(buf, "ping", millis(), 30000);
});