diff --git a/esphome/core/time_64.cpp b/esphome/core/time_64.cpp index c967505544..d067bc11c6 100644 --- a/esphome/core/time_64.cpp +++ b/esphome/core/time_64.cpp @@ -21,7 +21,9 @@ static constexpr uint32_t HALF_MAX_UINT32 = std::numeric_limits::max() uint64_t Millis64Impl::compute(uint32_t now) { // State variables for rollover tracking - static to persist across calls +#ifndef ESPHOME_THREAD_SINGLE static Mutex lock; +#endif #ifdef ESPHOME_THREAD_MULTI_ATOMICS /* * Multi-threaded platforms with atomic support: last_millis needs atomic for lock-free updates.