Restore explicit cast for -Wsign-conversion consistency

millis() on the line above casts esp_timer_get_time() to uint32_t.
Match that pattern in millis_64() with static_cast<uint64_t> to
avoid implicit signed-to-unsigned conversion.
This commit is contained in:
J. Nick Koston
2026-02-26 23:05:18 -10:00
parent 554e2ac7f1
commit 33d4f62510
+1 -1
View File
@@ -23,7 +23,7 @@ namespace esphome {
void HOT yield() { vPortYield(); }
uint32_t IRAM_ATTR HOT millis() { return (uint32_t) (esp_timer_get_time() / 1000ULL); }
uint64_t HOT millis_64() { return esp_timer_get_time() / 1000ULL; }
uint64_t HOT millis_64() { return static_cast<uint64_t>(esp_timer_get_time()) / 1000ULL; }
void HOT delay(uint32_t ms) { vTaskDelay(ms / portTICK_PERIOD_MS); }
uint32_t IRAM_ATTR HOT micros() { return (uint32_t) esp_timer_get_time(); }
void IRAM_ATTR HOT delayMicroseconds(uint32_t us) { delay_microseconds_safe(us); }