fix(doorbell-touch): add touch debug logging and missing TFT_MISO pin
This commit is contained in:
7
.clangd
7
.clangd
@@ -12,6 +12,7 @@ CompileFlags:
|
||||
- "-I/home/david/.arduino15/packages/esp32/hardware/esp32/3.3.6/libraries"
|
||||
- "-I/home/david/.arduino15/packages/esp32/tools/esp32-libs/3.3.6/include"
|
||||
- "-I/home/david/.arduino15/packages/esp32/tools/esp32-libs/3.3.6/include/freertos/FreeRTOS-Kernel/include"
|
||||
- "-I/home/david/.arduino15/packages/esp32/tools/esp32-libs/3.3.6/include/freertos/config/include/freertos"
|
||||
- "-I/home/david/.arduino15/packages/esp32/tools/esp32-libs/3.3.6/include/freertos/config/include"
|
||||
- "-I/home/david/.arduino15/packages/arduino/hardware/arduino/1.8.6/cores/arduino"
|
||||
- "-I/home/david/.arduino15/packages/arduino/hardware/arduino/1.8.6/libraries/WiFi/src"
|
||||
@@ -22,8 +23,14 @@ CompileFlags:
|
||||
- "-I/home/david/Arduino/sketches/doorbell-touch/vendor/esp32-s3-lcd-43/LovyanGFX/src/lgfx"
|
||||
- "-I/home/david/Arduino/sketches/doorbell-touch/vendor/esp32-s3-lcd-43/LovyanGFX/src/lgfx/v0"
|
||||
- "-I/home/david/Arduino/sketches/doorbell-touch/vendor/esp32-s3-lcd-43/LovyanGFX/src/lgfx/v0/platforms/esp32"
|
||||
- "-I/home/david/Arduino/sketches/doorbell-touch/boards/esp32-32e"
|
||||
- "-I/home/david/Arduino/sketches/doorbell-touch/boards/esp32-32e-4"
|
||||
- "-I/home/david/Arduino/sketches/doorbell-touch/vendor/esp32-32e/TFT_eSPI"
|
||||
- "-I/home/david/Arduino/sketches/doorbell-touch/vendor/esp32-32e-4/TFT_eSPI"
|
||||
- "-I/home/david/Arduino/sketchbook/libraries/XPT2046_Touchscreen"
|
||||
|
||||
Diagnostics:
|
||||
ClangTidy:
|
||||
Remove: [readability-*, modernize-*, performance-*, bugprone-*]
|
||||
Add: [clang-diagnostic-*, modernize-use-trailing-return-type]
|
||||
UnusedIncludes: Strict
|
||||
|
||||
@@ -11,6 +11,10 @@ void DisplayDriverTFT::begin() {
|
||||
|
||||
Serial.printf("[GFX] Display OK: %dx%d\n", DISPLAY_WIDTH, DISPLAY_HEIGHT);
|
||||
|
||||
// Debug: check if touch controller is responding
|
||||
uint16_t z = _tft.getTouchRawZ();
|
||||
Serial.printf("[TOUCH] Raw Z=%d (non-zero = controller detected)\n", z);
|
||||
|
||||
drawBoot();
|
||||
|
||||
digitalWrite(PIN_LCD_BL, HIGH);
|
||||
@@ -118,10 +122,12 @@ void DisplayDriverTFT::drawDashboard(const ScreenState& st) {
|
||||
TouchEvent DisplayDriverTFT::readTouch() {
|
||||
TouchEvent evt;
|
||||
uint16_t tx, ty;
|
||||
if(_tft.getTouch(&tx, &ty)) {
|
||||
uint8_t touched = _tft.getTouch(&tx, &ty, 100);
|
||||
if(touched) {
|
||||
evt.pressed = true;
|
||||
evt.x = tx;
|
||||
evt.y = ty;
|
||||
Serial.printf("[TOUCH] x=%d, y=%d\n", tx, ty);
|
||||
}
|
||||
return evt;
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#define TFT_HEIGHT 480
|
||||
|
||||
// ── SPI Pins (from lcdwiki.com/4.0inch_ESP32-32E_Display) ──
|
||||
#define TFT_MISO 12
|
||||
#define TFT_MOSI 13
|
||||
#define TFT_SCLK 14
|
||||
#define TFT_CS 15
|
||||
|
||||
@@ -141,9 +141,9 @@ arduino-cli upload \
|
||||
"""
|
||||
|
||||
[tasks.monitor-32e-4]
|
||||
description = "Serial monitor for ESP32-32E-4\""
|
||||
description = "Serial monitor for ESP32-32E 4 inch"
|
||||
run = """
|
||||
arduino-cli monitor --port "${PORT:-/dev/ttyUSB0}" --config baudrate=115200
|
||||
arduino-cli monitor -p "${PORT:-/dev/ttyUSB0}" --config 115200
|
||||
"""
|
||||
|
||||
# ── ESP32-S3-LCD-4.3 ────────────────────────────────────
|
||||
|
||||
Reference in New Issue
Block a user