mirror of
https://github.com/esphome/esphome.git
synced 2025-09-07 13:52:20 +01:00
Reduce number of calls to fetch time in the main loop (#8804)
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
#include "esp32_camera.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/hal.h"
|
||||
#include "esphome/core/application.h"
|
||||
|
||||
#include <freertos/task.h>
|
||||
|
||||
@@ -162,7 +163,7 @@ void ESP32Camera::loop() {
|
||||
}
|
||||
|
||||
// request idle image every idle_update_interval
|
||||
const uint32_t now = millis();
|
||||
const uint32_t now = App.get_loop_component_start_time();
|
||||
if (this->idle_update_interval_ != 0 && now - this->last_idle_request_ > this->idle_update_interval_) {
|
||||
this->last_idle_request_ = now;
|
||||
this->request_image(IDLE);
|
||||
|
Reference in New Issue
Block a user