Fix no-release bug on ft6x36 (#6527)

This commit is contained in:
Clyde Stubbs 2024-04-15 11:08:35 +10:00 committed by GitHub
parent b43ad5da6d
commit 86f9af13aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 3 deletions

View File

@ -32,7 +32,7 @@ void FT63X6Touchscreen::setup() {
if (this->interrupt_pin_ != nullptr) {
this->interrupt_pin_->pin_mode(gpio::FLAG_INPUT | gpio::FLAG_PULLUP);
this->interrupt_pin_->setup();
this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_FALLING_EDGE);
this->attach_interrupt_(this->interrupt_pin_, gpio::INTERRUPT_ANY_EDGE);
}
if (this->reset_pin_ != nullptr) {
@ -78,13 +78,12 @@ void FT63X6Touchscreen::update_touches() {
uint16_t touch_id, x, y;
uint8_t touches = this->read_touch_number_();
ESP_LOGV(TAG, "Touches found: %d", touches);
if ((touches == 0x00) || (touches == 0xff)) {
// ESP_LOGD(TAG, "No touches detected");
return;
}
ESP_LOGV(TAG, "Touches found: %d", touches);
for (auto point = 0; point < touches; point++) {
if (((this->read_touch_event_(point)) & 0x01) == 0) { // checking event flag bit 6 if it is null
touch_id = this->read_touch_id_(point); // id1 = 0 or 1