Files
klubhaus-doorbell/sketches/doorbell-touch-esp32-32e/doorbell-touch-esp32-32e.ino
David Gwilliam 1e596c0fab This commit breaks the doorbell functionality completely
1. **Removed entire `loop()` implementation** - The main program loop is now completely empty
2. **Deleted duplicate `silenceAlerts()` functions** - Three identical copies were consolidated into one
3. **Stripped all functionality**:
   - Touch handling for different screens (ALERT, DASHBOARD, OFF)
   - Hold-to-silence gesture detection
   - Display rendering and backlight control
   - Serial command processing

⚠️ **This commit breaks the doorbell functionality completely**:
- The device will boot but do nothing (empty loop)
- Touch input won't be processed
- Screen won't update or display anything
- Serial commands won't work
- Alert silencing is defined but never called

This appears to be an incomplete snapshot/refactoring in progress, leaving the application non-functional.

1. **Gutted the main loop** - Reduced from ~80 lines to completely empty
2. **Removed duplicate code** - Eliminated 2 of 3 identical `silenceAlerts()` function definitions that were accidentally created

**Device is now completely non-functional:**
- No display updates or rendering
- Touch input completely ignored
- Alert silencing impossible (function defined but never called)
- Serial commands won't be processed
- Screen stays on/off in whatever state it was in

This is clearly an accidental commit or work-in-progress snapshot. The doorbell will compile and run but do absolutely nothing except the initial setup.
2026-02-16 19:07:42 -08:00

75 lines
1.7 KiB
C++

/*
* KLUBHAUS ALERT v5.1 — E32R35T 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
#error "TFT_eSPI setup mismatch — ST7796_DRIVER expected for E32R35T"
#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 — E32R35T");
#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() {
}