1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-18 11:12:20 +01:00

[gt911][cst226][ektf2232] Swap x and y calibration values (#8450)

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
This commit is contained in:
Clyde Stubbs
2025-03-24 20:07:21 +11:00
committed by GitHub
parent 6787730aa4
commit 6cfe3ac44d
3 changed files with 33 additions and 23 deletions

View File

@@ -72,6 +72,8 @@ void CST226Touchscreen::continue_setup_() {
if (this->read16_(0xD1F8, buffer, 4)) {
this->x_raw_max_ = buffer[0] + (buffer[1] << 8);
this->y_raw_max_ = buffer[2] + (buffer[3] << 8);
if (this->swap_x_y_)
std::swap(this->x_raw_max_, this->y_raw_max_);
} else {
this->x_raw_max_ = this->display_->get_native_width();
this->y_raw_max_ = this->display_->get_native_height();