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

View file

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