mirror of
https://github.com/esphome/esphome.git
synced 2026-05-28 13:37:24 +08:00
[lilygo_t5_47] Fix Y coordinate mapping and clamp touch point count (#14865)
This commit is contained in:
@@ -42,7 +42,7 @@ void LilygoT547Touchscreen::setup() {
|
|||||||
this->x_raw_max_ = this->display_->get_native_width();
|
this->x_raw_max_ = this->display_->get_native_width();
|
||||||
}
|
}
|
||||||
if (this->y_raw_max_ == this->y_raw_min_) {
|
if (this->y_raw_max_ == this->y_raw_min_) {
|
||||||
this->x_raw_max_ = this->display_->get_native_height();
|
this->y_raw_max_ = this->display_->get_native_height();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -64,6 +64,10 @@ void LilygoT547Touchscreen::update_touches() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
point = buffer[5] & 0xF;
|
point = buffer[5] & 0xF;
|
||||||
|
if (point > 2) {
|
||||||
|
ESP_LOGW(TAG, "Invalid touch point count: %d", point);
|
||||||
|
point = 2;
|
||||||
|
}
|
||||||
|
|
||||||
if (point == 1) {
|
if (point == 1) {
|
||||||
err = this->write_register(TOUCH_REGISTER, READ_TOUCH, 1);
|
err = this->write_register(TOUCH_REGISTER, READ_TOUCH, 1);
|
||||||
|
|||||||
Reference in New Issue
Block a user