mirror of
https://github.com/esphome/esphome.git
synced 2025-08-05 09:57:47 +00:00
preen
This commit is contained in:
parent
e355ce04f7
commit
48957aee8b
@ -89,6 +89,7 @@ void HOT Scheduler::set_timer_common_(Component *component, SchedulerItem::Type
|
||||
if (delay == 0 && type == SchedulerItem::TIMEOUT) {
|
||||
// Put in defer queue for guaranteed FIFO execution
|
||||
LockGuard guard{this->lock_};
|
||||
this->cancel_deferred_item_locked_(component, is_static_string, name_ptr, type);
|
||||
this->defer_queue_.push_back(std::move(item));
|
||||
return;
|
||||
}
|
||||
@ -434,7 +435,7 @@ size_t HOT Scheduler::cancel_deferred_item_locked_(Component *component, const c
|
||||
SchedulerItem::Type type) {
|
||||
size_t cancelled_count = 0;
|
||||
for (auto &item : this->defer_queue_) {
|
||||
if (item->component != component || item->type != type || item->remove) {
|
||||
if (item->component != component || item->remove) {
|
||||
continue;
|
||||
}
|
||||
const char *item_name = item->get_name();
|
||||
|
@ -157,9 +157,11 @@ class Scheduler {
|
||||
// Cancel heap items (items_ and to_add_)
|
||||
bool cancel_heap_item_(Component *component, bool is_static_string, const void *name_ptr, SchedulerItem::Type type);
|
||||
|
||||
#if !defined(USE_ESP8266) && !defined(USE_RP2040)
|
||||
// Cancel deferred items (defer_queue_)
|
||||
bool cancel_deferred_item_(Component *component, bool is_static_string, const void *name_ptr,
|
||||
SchedulerItem::Type type);
|
||||
#endif
|
||||
|
||||
private:
|
||||
// Helper to execute a scheduler item
|
||||
|
Loading…
x
Reference in New Issue
Block a user