Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rename set_raw_touch_position_ to add_raw_touch_position_ #5962

Merged
merged 1 commit into from
Dec 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion esphome/components/ektf2232/touchscreen/ektf2232.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions esphome/components/ft63x6/ft63x6.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion esphome/components/gt911/touchscreen/gt911_touchscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/touchscreen/touchscreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/touchscreen/touchscreen.h
Original file line number Diff line number Diff line change
Expand Up @@ -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_();

Expand Down
2 changes: 1 addition & 1 deletion esphome/components/tt21100/touchscreen/tt21100.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion esphome/components/xpt2046/touchscreen/xpt2046.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down