1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-15 17:52:19 +01:00
This commit is contained in:
J. Nick Koston
2025-06-12 18:30:53 -05:00
parent 1e24417db0
commit b32fc3bfdd
3 changed files with 9 additions and 9 deletions

View File

@@ -68,9 +68,9 @@ class ESP32TouchComponent : public Component {
// Common helper methods // Common helper methods
void dump_config_base_(); void dump_config_base_();
void dump_config_sensors_(); void dump_config_sensors_();
bool create_touch_queue(); bool create_touch_queue_();
void cleanup_touch_queue(); void cleanup_touch_queue_();
void configure_wakeup_pads(); void configure_wakeup_pads_();
// Common members // Common members
std::vector<ESP32TouchBinarySensor *> children_; std::vector<ESP32TouchBinarySensor *> children_;

View File

@@ -33,7 +33,7 @@ void ESP32TouchComponent::dump_config_sensors_() {
} }
} }
bool ESP32TouchComponent::create_touch_queue() { bool ESP32TouchComponent::create_touch_queue_() {
// Queue size calculation: children * 4 allows for burst scenarios where ISR // Queue size calculation: children * 4 allows for burst scenarios where ISR
// fires multiple times before main loop processes. // fires multiple times before main loop processes.
size_t queue_size = this->children_.size() * 4; size_t queue_size = this->children_.size() * 4;
@@ -54,14 +54,14 @@ bool ESP32TouchComponent::create_touch_queue() {
return true; return true;
} }
void ESP32TouchComponent::cleanup_touch_queue() { void ESP32TouchComponent::cleanup_touch_queue_() {
if (this->touch_queue_) { if (this->touch_queue_) {
vQueueDelete(this->touch_queue_); vQueueDelete(this->touch_queue_);
this->touch_queue_ = nullptr; this->touch_queue_ = nullptr;
} }
} }
void ESP32TouchComponent::configure_wakeup_pads() { void ESP32TouchComponent::configure_wakeup_pads_() {
bool is_wakeup_source = false; bool is_wakeup_source = false;
// Check if any pad is configured for wakeup // Check if any pad is configured for wakeup

View File

@@ -23,7 +23,7 @@ void ESP32TouchComponent::setup() {
// Queue size calculation: children * 4 allows for burst scenarios where ISR // Queue size calculation: children * 4 allows for burst scenarios where ISR
// fires multiple times before main loop processes. This is important because // fires multiple times before main loop processes. This is important because
// ESP32 v1 scans all pads on each interrupt, potentially sending multiple events. // ESP32 v1 scans all pads on each interrupt, potentially sending multiple events.
if (!this->create_touch_queue()) { if (!this->create_touch_queue_()) {
return; return;
} }
@@ -53,7 +53,7 @@ void ESP32TouchComponent::setup() {
esp_err_t err = touch_pad_isr_register(touch_isr_handler, this); esp_err_t err = touch_pad_isr_register(touch_isr_handler, this);
if (err != ESP_OK) { if (err != ESP_OK) {
ESP_LOGE(TAG, "Failed to register touch ISR: %s", esp_err_to_name(err)); ESP_LOGE(TAG, "Failed to register touch ISR: %s", esp_err_to_name(err));
this->cleanup_touch_queue(); this->cleanup_touch_queue_();
this->mark_failed(); this->mark_failed();
return; return;
} }
@@ -187,7 +187,7 @@ void ESP32TouchComponent::on_shutdown() {
} }
// Configure wakeup pads if any are set // Configure wakeup pads if any are set
this->configure_wakeup_pads(); this->configure_wakeup_pads_();
} }
void IRAM_ATTR ESP32TouchComponent::touch_isr_handler(void *arg) { void IRAM_ATTR ESP32TouchComponent::touch_isr_handler(void *arg) {