- TOUCH_SDA=17 SCL=18 RST=38 per Waveshare schematic - GPIO 8/9 conflict with LCD_B0/B3 was blanking the display - Banner uses BOARD_NAME macro instead of hard-coded E32R35T - TFT_eSPI #error wrapped in USE_TFT_ESPI guard - RGB test fills on separate lines so they actually execute
77 lines
1.8 KiB
C++
77 lines
1.8 KiB
C++
/*
|
|
* KLUBHAUS ALERT v5.1 — " BOARD_NAME " Edition
|
|
*
|
|
* Target: LCDWiki E32R35T (ESP32-WROOM-32E + 3.5" ST7796S + XPT2046)
|
|
*
|
|
* Hold-and-release interaction model:
|
|
* - Hold finger → progress bar fills
|
|
* - Bar full → jitter/flash ("RELEASE!")
|
|
* - Lift finger → action fires (finger already off screen)
|
|
*/
|
|
|
|
#include <SPI.h>
|
|
#include "Config.h"
|
|
#include "DisplayManager.h"
|
|
#include "DoorbellLogic.h"
|
|
#include "BoardConfig.h"
|
|
|
|
#include <TFT_eSPI.h>
|
|
#ifndef LOAD_GLCD
|
|
#error "LOAD_GLCD is NOT defined — fonts missing!"
|
|
#endif
|
|
#if USE_TFT_ESPI
|
|
#ifndef ST7796_DRIVER
|
|
#if USE_TFT_ESPI
|
|
#error "TFT_eSPI setup mismatch — ST7796_DRIVER expected for E32R35T"
|
|
#endif
|
|
#endif
|
|
#endif
|
|
#define HOLD_TO_SILENCE_MS 1000
|
|
|
|
DoorbellLogic logic;
|
|
DisplayManager display;
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
unsigned long t = millis();
|
|
while (!Serial && millis() - t < 3000) delay(10);
|
|
delay(500);
|
|
|
|
Serial.println("\n========================================");
|
|
Serial.println(" KLUBHAUS ALERT v5.1 — " BOARD_NAME "");
|
|
#if DEBUG_MODE
|
|
Serial.println(" *** DEBUG MODE — _test topics ***");
|
|
#endif
|
|
Serial.println("========================================");
|
|
|
|
display.begin();
|
|
|
|
logic.begin();
|
|
display.render(logic.getScreenState());
|
|
delay(1500);
|
|
|
|
logic.beginWiFi();
|
|
display.render(logic.getScreenState());
|
|
|
|
logic.connectWiFiBlocking();
|
|
display.render(logic.getScreenState());
|
|
delay(1500);
|
|
|
|
logic.finishBoot();
|
|
display.setBacklight(false);
|
|
|
|
Serial.println("[BOOT] Ready — monitoring ntfy.sh\n");
|
|
}
|
|
|
|
|
|
|
|
// ── Silence handler (delegates to DoorbellLogic) ────────────────
|
|
void silenceAlerts() {
|
|
Serial.println("[SILENCE] User completed hold-to-silence gesture");
|
|
logic.onTouch(TouchEvent{true, 0, 0});
|
|
}
|
|
|
|
void loop() {
|
|
}
|
|
|