mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 10:56:43 +00:00
[core] Add millis_64() HAL function with native ESP32 implementation (#14339)
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user