mirror of
https://github.com/esphome/esphome.git
synced 2026-05-28 13:37:24 +08:00
[core] Remove call_loop_ wrapper and call loop() directly (#14931)
This commit is contained in:
@@ -209,7 +209,6 @@ bool Component::cancel_retry(uint32_t id) {
|
|||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop
|
||||||
}
|
}
|
||||||
|
|
||||||
void Component::call_loop_() { this->loop(); }
|
|
||||||
void Component::call_setup() { this->setup(); }
|
void Component::call_setup() { this->setup(); }
|
||||||
void Component::call_dump_config_() {
|
void Component::call_dump_config_() {
|
||||||
this->dump_config();
|
this->dump_config();
|
||||||
@@ -259,11 +258,11 @@ void Component::call() {
|
|||||||
case COMPONENT_STATE_SETUP:
|
case COMPONENT_STATE_SETUP:
|
||||||
// State setup: Call first loop and set state to loop
|
// State setup: Call first loop and set state to loop
|
||||||
this->set_component_state_(COMPONENT_STATE_LOOP);
|
this->set_component_state_(COMPONENT_STATE_LOOP);
|
||||||
this->call_loop_();
|
this->loop();
|
||||||
break;
|
break;
|
||||||
case COMPONENT_STATE_LOOP:
|
case COMPONENT_STATE_LOOP:
|
||||||
// State loop: Call loop
|
// State loop: Call loop
|
||||||
this->call_loop_();
|
this->loop();
|
||||||
break;
|
break;
|
||||||
case COMPONENT_STATE_FAILED:
|
case COMPONENT_STATE_FAILED:
|
||||||
// State failed: Do nothing
|
// State failed: Do nothing
|
||||||
|
|||||||
@@ -301,7 +301,6 @@ class Component {
|
|||||||
protected:
|
protected:
|
||||||
friend class Application;
|
friend class Application;
|
||||||
|
|
||||||
void call_loop_();
|
|
||||||
virtual void call_setup();
|
virtual void call_setup();
|
||||||
void call_dump_config_();
|
void call_dump_config_();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user