mirror of
https://github.com/esphome/esphome.git
synced 2026-10-06 02:51:29 +00:00
Reduce number of calls to fetch time in the main loop (#8804)
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
#include "modbus.h"
|
||||
#include "esphome/core/log.h"
|
||||
#include "esphome/core/helpers.h"
|
||||
#include "esphome/core/application.h"
|
||||
|
||||
namespace esphome {
|
||||
namespace modbus {
|
||||
@@ -13,7 +14,7 @@ void Modbus::setup() {
|
||||
}
|
||||
}
|
||||
void Modbus::loop() {
|
||||
const uint32_t now = millis();
|
||||
const uint32_t now = App.get_loop_component_start_time();
|
||||
|
||||
while (this->available()) {
|
||||
uint8_t byte;
|
||||
|
||||
Reference in New Issue
Block a user