14781b8c07
- Pure static helper class moved from DisplayManager.h to Style.h - Drivers now use TileLayoutHelper::calculateLayouts() directly - Remove extern DisplayManager references from display drivers - Drop LGFX_USE_V1 build flag (no longer needed) - Add delay(LOOP_YIELD_MS) in S3 loop to prevent watchdog
45 lines
910 B
Arduino
45 lines
910 B
Arduino
//
|
|
// Klubhaus Doorbell — ESP32-S3-Touch-LCD-4.3 target
|
|
//
|
|
|
|
#include "DisplayDriverGFX.h"
|
|
#include "board_config.h"
|
|
#include "secrets.h"
|
|
|
|
#include <KlubhausCore.h>
|
|
|
|
DisplayDriverGFX gfxDriver;
|
|
DisplayManager display(&gfxDriver);
|
|
DoorbellLogic logic(&display);
|
|
|
|
void setup() {
|
|
Serial.begin(115200);
|
|
delay(500);
|
|
|
|
logic.begin(FW_VERSION, BOARD_NAME, wifiNetworks, wifiNetworkCount);
|
|
logic.finishBoot();
|
|
}
|
|
|
|
void loop() {
|
|
// Read touch (includes test injection via serial "touch x y press/release")
|
|
TouchEvent evt = display.readTouch();
|
|
|
|
// State machine tick
|
|
logic.update();
|
|
|
|
// Render current screen
|
|
display.render(logic.getScreenState());
|
|
|
|
// Handle tap gestures
|
|
logic.handleTouch(evt);
|
|
|
|
// Handle hold-to-silence gesture
|
|
logic.updateHold(evt);
|
|
|
|
// Serial console
|
|
logic.processSerial();
|
|
|
|
// Yield to WiFi/BT stack
|
|
delay(LOOP_YIELD_MS);
|
|
}
|