1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-22 18:48:14 +00:00

[ft63x6] Get correct dimensions from display (#8417)

This commit is contained in:
Clyde Stubbs 2025-03-20 15:37:44 +11:00 committed by GitHub
parent 64ff62c005
commit 6ea89644e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}