42 lines
790 B
C++
42 lines
790 B
C++
//
|
|
// 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
|
|
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();
|
|
}
|