This commit is contained in:
J. Nick Koston 2025-07-06 18:17:16 -05:00
parent 339a3270f6
commit e077e6cec7
No known key found for this signature in database

View File

@ -82,8 +82,6 @@ void HOT Scheduler::set_timer_common_(Component *component, SchedulerItem::Type
item->callback = std::move(func);
item->remove = false;
const auto now = this->millis_();
#if !defined(USE_ESP8266) && !defined(USE_RP2040)
// Special handling for defer() (delay = 0, type = TIMEOUT)
// ESP8266 and RP2040 are excluded because they don't need thread-safe defer handling
@ -96,6 +94,8 @@ void HOT Scheduler::set_timer_common_(Component *component, SchedulerItem::Type
}
#endif
const auto now = this->millis_();
// Type-specific setup
if (type == SchedulerItem::INTERVAL) {
item->interval = delay;