feat(touch): add continuous touch polling and debug logging

This commit is contained in:
2026-02-17 23:20:42 -08:00
parent 17c44d9b08
commit 4f389ac0fe
4 changed files with 26 additions and 0 deletions

View File

@@ -10,15 +10,18 @@ void DisplayDriverTFT::begin() {
_tft.fillScreen(TFT_BLACK);
Serial.printf("[GFX] Display OK: %dx%d\n", DISPLAY_WIDTH, DISPLAY_HEIGHT);
Serial.flush();
// Debug: check if touch controller is responding
uint16_t z = _tft.getTouchRawZ();
Serial.printf("[TOUCH] Raw Z=%d (non-zero = controller detected)\n", z);
Serial.flush();
drawBoot();
digitalWrite(PIN_LCD_BL, HIGH);
Serial.println("[GFX] Backlight ON");
Serial.flush();
}
void DisplayDriverTFT::setBacklight(bool on) { digitalWrite(PIN_LCD_BL, on ? HIGH : LOW); }
@@ -132,6 +135,10 @@ TouchEvent DisplayDriverTFT::readTouch() {
return evt;
}
uint16_t DisplayDriverTFT::getRawTouchZ() {
return _tft.getTouchRawZ();
}
int DisplayDriverTFT::dashboardTouch(int x, int y) {
// 2x2 grid, accounting for 30px header
if(y < 30)