avoid conversion to resolution

This commit is contained in:
SGE 2024-04-01 20:52:58 +02:00
parent 1c2801e1d3
commit b13200f2af
3 changed files with 6 additions and 2 deletions

View file

@ -23,6 +23,7 @@ void ICNT86Touchscreen::setup() {
this->reset_pin_->setup(); this->reset_pin_->setup();
this->reset_(); this->reset_();
} }
this->conversion_to_resolution_ = false;
// Trigger initial read to activate the interrupt // Trigger initial read to activate the interrupt
this->store_.touched = true; this->store_.touched = true;
} }

View file

@ -94,8 +94,10 @@ void Touchscreen::add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_r
std::swap(x, y); std::swap(x, y);
} }
tp.x = (uint16_t) ((int) x * this->display_width_ / 0x1000); if (this->conversion_to_resolution_) {
tp.y = (uint16_t) ((int) y * this->display_height_ / 0x1000); tp.x = (uint16_t) ((int) x * this->display_width_ / 0x1000);
tp.y = (uint16_t) ((int) y * this->display_height_ / 0x1000);
}
} else { } else {
tp.state |= STATE_CALIBRATE; tp.state |= STATE_CALIBRATE;
} }

View file

@ -117,6 +117,7 @@ class Touchscreen : public PollingComponent {
bool is_touched_{false}; bool is_touched_{false};
bool was_touched_{false}; bool was_touched_{false};
bool skip_update_{false}; bool skip_update_{false};
bool conversion_to_resolution_{true};
}; };
} // namespace touchscreen } // namespace touchscreen