mirror of
https://github.com/esphome/esphome.git
synced 2025-07-27 13:46:48 +00:00
[axs15231] Don't overwrite manual dimensions (#8553)
This commit is contained in:
parent
ca78dd44b5
commit
264e234efc
@ -30,8 +30,12 @@ void AXS15231Touchscreen::setup() {
|
|||||||
this->interrupt_pin_->setup();
|
this->interrupt_pin_->setup();
|
||||||
this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_FALLING_EDGE);
|
this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_FALLING_EDGE);
|
||||||
}
|
}
|
||||||
this->x_raw_max_ = this->display_->get_native_width();
|
if (this->x_raw_max_ == 0) {
|
||||||
this->y_raw_max_ = this->display_->get_native_height();
|
this->x_raw_max_ = this->display_->get_native_width();
|
||||||
|
}
|
||||||
|
if (this->y_raw_max_ == 0) {
|
||||||
|
this->y_raw_max_ = this->display_->get_native_height();
|
||||||
|
}
|
||||||
ESP_LOGCONFIG(TAG, "AXS15231 Touchscreen setup complete");
|
ESP_LOGCONFIG(TAG, "AXS15231 Touchscreen setup complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -44,7 +48,7 @@ void AXS15231Touchscreen::update_touches() {
|
|||||||
err = this->read(data, sizeof(data));
|
err = this->read(data, sizeof(data));
|
||||||
ERROR_CHECK(err);
|
ERROR_CHECK(err);
|
||||||
this->status_clear_warning();
|
this->status_clear_warning();
|
||||||
if (data[0] != 0) // no touches
|
if (data[0] != 0 || data[1] == 0) // no touches
|
||||||
return;
|
return;
|
||||||
uint16_t x = encode_uint16(data[2] & 0xF, data[3]);
|
uint16_t x = encode_uint16(data[2] & 0xF, data[3]);
|
||||||
uint16_t y = encode_uint16(data[4] & 0xF, data[5]);
|
uint16_t y = encode_uint16(data[4] & 0xF, data[5]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user