Move HALF_MAX_UINT32 inside compute() function

Only used within the function, matches the pattern of ROLLOVER_WINDOW.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
J. Nick Koston
2026-02-27 11:04:46 -10:00
co-authored by Claude Opus 4.6
parent 3d674ae1d2
commit c9a2fe5b80
+3 -3
View File
@@ -16,10 +16,10 @@ namespace esphome {
static const char *const TAG = "time_64";
// Half the 32-bit range - used to detect rollovers vs normal time progression
static constexpr uint32_t HALF_MAX_UINT32 = std::numeric_limits<uint32_t>::max() / 2;
uint64_t Millis64Impl::compute(uint32_t now) {
// Half the 32-bit range - used to detect rollovers vs normal time progression
static constexpr uint32_t HALF_MAX_UINT32 = std::numeric_limits<uint32_t>::max() / 2;
// State variables for rollover tracking - static to persist across calls
#ifdef ESPHOME_THREAD_MULTI_ATOMICS
// Mutex for rollover serialization (taken only every ~49.7 days).