1
0
mirror of https://github.com/esphome/esphome.git synced 2025-11-16 06:45:48 +00:00

[scheduler] Fix timing breakage after 49 days of uptime on ESP8266/RP2040 (#11924)

This commit is contained in:
J. Nick Koston
2025-11-15 22:20:57 -06:00
committed by GitHub
parent 6b158e760d
commit fc546ca3f6

View File

@@ -609,13 +609,12 @@ uint64_t Scheduler::millis_64_(uint32_t now) {
if (now < last && (last - now) > HALF_MAX_UINT32) {
this->millis_major_++;
major++;
this->last_millis_ = now;
#ifdef ESPHOME_DEBUG_SCHEDULER
ESP_LOGD(TAG, "Detected true 32-bit rollover at %" PRIu32 "ms (was %" PRIu32 ")", now, last);
#endif /* ESPHOME_DEBUG_SCHEDULER */
}
// Only update if time moved forward
if (now > last) {
} else if (now > last) {
// Only update if time moved forward
this->last_millis_ = now;
}