From 6ea89644e7476d3f8326c744d57060e987f13175 Mon Sep 17 00:00:00 2001 From: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com> Date: Thu, 20 Mar 2025 15:37:44 +1100 Subject: [PATCH] [ft63x6] Get correct dimensions from display (#8417) --- esphome/components/ft63x6/ft63x6.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/esphome/components/ft63x6/ft63x6.cpp b/esphome/components/ft63x6/ft63x6.cpp index e5f7613901..8bc66822eb 100644 --- a/esphome/components/ft63x6/ft63x6.cpp +++ b/esphome/components/ft63x6/ft63x6.cpp @@ -42,10 +42,10 @@ void FT63X6Touchscreen::setup() { // Get touch resolution if (this->x_raw_max_ == this->x_raw_min_) { - this->x_raw_max_ = 320; + this->x_raw_max_ = this->display_->get_native_width(); } if (this->y_raw_max_ == this->y_raw_min_) { - this->y_raw_max_ = 480; + this->y_raw_max_ = this->display_->get_native_height(); } uint8_t chip_id = this->read_byte_(FT63X6_ADDR_CHIP_ID); if (chip_id != 0) { @@ -71,6 +71,8 @@ void FT63X6Touchscreen::dump_config() { LOG_I2C_DEVICE(this); LOG_PIN(" Interrupt Pin: ", this->interrupt_pin_); LOG_PIN(" Reset Pin: ", this->reset_pin_); + ESP_LOGCONFIG(TAG, " X Calibration: [%d, %d]", this->x_raw_min_, this->x_raw_max_); + ESP_LOGCONFIG(TAG, " Y Calibration: [%d, %d]", this->y_raw_min_, this->y_raw_max_); LOG_UPDATE_INTERVAL(this); }