From 8961e8ab32cd398405b59fb6e806db91c9150439 Mon Sep 17 00:00:00 2001 From: NP v/d Spek Date: Mon, 18 Dec 2023 20:23:22 +0100 Subject: [PATCH] rename set_raw_touch_position_ to add_raw_touch_position_ (#5962) --- esphome/components/ektf2232/touchscreen/ektf2232.cpp | 2 +- esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h | 2 +- esphome/components/ft63x6/ft63x6.cpp | 4 ++-- esphome/components/gt911/touchscreen/gt911_touchscreen.cpp | 2 +- .../lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp | 2 +- esphome/components/touchscreen/touchscreen.cpp | 2 +- esphome/components/touchscreen/touchscreen.h | 2 +- esphome/components/tt21100/touchscreen/tt21100.cpp | 2 +- esphome/components/xpt2046/touchscreen/xpt2046.cpp | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-) diff --git a/esphome/components/ektf2232/touchscreen/ektf2232.cpp b/esphome/components/ektf2232/touchscreen/ektf2232.cpp index 1a2c0389af..00e00bc7e6 100644 --- a/esphome/components/ektf2232/touchscreen/ektf2232.cpp +++ b/esphome/components/ektf2232/touchscreen/ektf2232.cpp @@ -74,7 +74,7 @@ void EKTF2232Touchscreen::update_touches() { uint8_t *d = raw + 1 + (i * 3); x_raw = (d[0] & 0xF0) << 4 | d[1]; y_raw = (d[0] & 0x0F) << 8 | d[2]; - this->set_raw_touch_position_(i, x_raw, y_raw); + this->add_raw_touch_position_(i, x_raw, y_raw); } } diff --git a/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h b/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h index 497d6c906c..0b3a2c1b86 100644 --- a/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h +++ b/esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h @@ -94,7 +94,7 @@ class FT5x06Touchscreen : public touchscreen::Touchscreen, public i2c::I2CDevice esph_log_d(TAG, "Read %X status, id: %d, pos %d/%d", status, id, x, y); if (status == 0 || status == 2) { - this->set_raw_touch_position_(id, x, y); + this->add_raw_touch_position_(id, x, y); } } } diff --git a/esphome/components/ft63x6/ft63x6.cpp b/esphome/components/ft63x6/ft63x6.cpp index 9198954253..b674ded22c 100644 --- a/esphome/components/ft63x6/ft63x6.cpp +++ b/esphome/components/ft63x6/ft63x6.cpp @@ -53,13 +53,13 @@ void FT63X6Touchscreen::update_touches() { uint8_t touch_id = this->read_touch_id_(FT63X6_ADDR_TOUCH1_ID); // id1 = 0 or 1 int16_t x = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH1_X); int16_t y = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH1_Y); - this->set_raw_touch_position_(touch_id, x, y); + this->add_raw_touch_position_(touch_id, x, y); if (touch_count >= 2) { touch_id = this->read_touch_id_(FT63X6_ADDR_TOUCH2_ID); // id2 = 0 or 1(~id1 & 0x01) x = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH2_X); y = this->read_touch_coordinate_(FT63X6_ADDR_TOUCH2_Y); - this->set_raw_touch_position_(touch_id, x, y); + this->add_raw_touch_position_(touch_id, x, y); } } diff --git a/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp b/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp index adc577f5da..84854d5b0d 100644 --- a/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +++ b/esphome/components/gt911/touchscreen/gt911_touchscreen.cpp @@ -92,7 +92,7 @@ void GT911Touchscreen::update_touches() { uint16_t id = data[i][0]; uint16_t x = encode_uint16(data[i][2], data[i][1]); uint16_t y = encode_uint16(data[i][4], data[i][3]); - this->set_raw_touch_position_(id, x, y); + this->add_raw_touch_position_(id, x, y); } auto keys = data[num_of_touches][0]; for (size_t i = 0; i != 4; i++) { diff --git a/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp b/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp index eb61b6f31e..64cc7ad4d1 100644 --- a/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp +++ b/esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp @@ -84,7 +84,7 @@ void LilygoT547Touchscreen::update_touches() { id = (buffer[i * 5] >> 4) & 0x0F; y_raw = (uint16_t) ((buffer[i * 5 + 1] << 4) | ((buffer[i * 5 + 3] >> 4) & 0x0F)); x_raw = (uint16_t) ((buffer[i * 5 + 2] << 4) | (buffer[i * 5 + 3] & 0x0F)); - this->set_raw_touch_position_(id, x_raw, y_raw); + this->add_raw_touch_position_(id, x_raw, y_raw); } this->status_clear_warning(); diff --git a/esphome/components/touchscreen/touchscreen.cpp b/esphome/components/touchscreen/touchscreen.cpp index 140f46b6f6..f095c2af8c 100644 --- a/esphome/components/touchscreen/touchscreen.cpp +++ b/esphome/components/touchscreen/touchscreen.cpp @@ -51,7 +51,7 @@ void Touchscreen::loop() { } } -void Touchscreen::set_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw) { +void Touchscreen::add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw) { TouchPoint tp; uint16_t x, y; if (this->touches_.count(id) == 0) { diff --git a/esphome/components/touchscreen/touchscreen.h b/esphome/components/touchscreen/touchscreen.h index 1fe304d967..74747c589c 100644 --- a/esphome/components/touchscreen/touchscreen.h +++ b/esphome/components/touchscreen/touchscreen.h @@ -87,7 +87,7 @@ class Touchscreen : public PollingComponent { void attach_interrupt_(InternalGPIOPin *irq_pin, esphome::gpio::InterruptType type); - void set_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw = 0); + void add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_raw, int16_t z_raw = 0); void send_touches_(); diff --git a/esphome/components/tt21100/touchscreen/tt21100.cpp b/esphome/components/tt21100/touchscreen/tt21100.cpp index ff688fd0b0..6b5cba74cd 100644 --- a/esphome/components/tt21100/touchscreen/tt21100.cpp +++ b/esphome/components/tt21100/touchscreen/tt21100.cpp @@ -109,7 +109,7 @@ void TT21100Touchscreen::update_touches() { i, touch->touch_type, touch->tip, touch->event_id, touch->touch_id, touch->x, touch->y, touch->pressure, touch->major_axis_length, touch->orientation); - this->set_raw_touch_position_(touch->tip, touch->x, touch->y, touch->pressure); + this->add_raw_touch_position_(touch->tip, touch->x, touch->y, touch->pressure); } } } diff --git a/esphome/components/xpt2046/touchscreen/xpt2046.cpp b/esphome/components/xpt2046/touchscreen/xpt2046.cpp index 1a9c202af0..a268da06dd 100644 --- a/esphome/components/xpt2046/touchscreen/xpt2046.cpp +++ b/esphome/components/xpt2046/touchscreen/xpt2046.cpp @@ -55,7 +55,7 @@ void XPT2046Component::update_touches() { ESP_LOGV(TAG, "Touchscreen Update [%d, %d], z = %d", x_raw, y_raw, z_raw); - this->set_raw_touch_position_(0, x_raw, y_raw, z_raw); + this->add_raw_touch_position_(0, x_raw, y_raw, z_raw); } }