Files
klubhaus-doorbell/sketches/doorbell-touch-esp32-32e/Config.h
David Gwilliam c6eb4e3875 feat: add board configuration system, refactor Config.h
Board selection driven by -DTARGET_E32R35T or -DTARGET_WAVESHARE_S3_43.
Defaults to E32R35T for backward compatibility.

All hardware pin definitions moved from Config.h to board headers.
SCREEN_WIDTH/SCREEN_HEIGHT now come from board headers.
Config.h is now purely application-level configuration.

New files:
  BoardConfig.h              — board selector
  boards/board_e32r35t.h     — E32R35T pins, display, touch config
  boards/board_waveshare_s3.h — Waveshare S3 4.3" pins, display, touch config

Modified:
  Config.h — removed hardware pins section, added #include BoardConfig.h,
             added HOLD_DURATION_MS to timing section
2026-02-16 12:38:13 -08:00

60 lines
2.1 KiB
C

#pragma once
#include "BoardConfig.h"
// =====================================================================
// Debug
// =====================================================================
#define DEBUG_MODE 1
// =====================================================================
// WiFi Credentials
// =====================================================================
struct WiFiCred { const char *ssid; const char *pass; };
static WiFiCred wifiNetworks[] = {
{ "Dobro Veče", "goodnight" },
{ "iot-2GHz", "lesson-greater" },
};
static const int NUM_WIFI = sizeof(wifiNetworks) / sizeof(wifiNetworks[0]);
// =====================================================================
// ntfy.sh Topics
// =====================================================================
#define NTFY_BASE "https://ntfy.sh"
#if DEBUG_MODE
#define TOPIC_SUFFIX "_test"
#else
#define TOPIC_SUFFIX ""
#endif
// Change since=10s to since=20s (must be > poll interval of 15s, but not too large)
#define ALERT_URL NTFY_BASE "/ALERT_klubhaus_topic" TOPIC_SUFFIX "/json?since=20s&poll=1"
#define SILENCE_URL NTFY_BASE "/SILENCE_klubhaus_topic" TOPIC_SUFFIX "/json?since=20s&poll=1"
#define ADMIN_URL NTFY_BASE "/ADMIN_klubhaus_topic" TOPIC_SUFFIX "/json?since=20s&poll=1"
#define STATUS_URL NTFY_BASE "/STATUS_klubhaus_topic" TOPIC_SUFFIX
// =====================================================================
// Timing
// =====================================================================
#define POLL_INTERVAL_MS 15000
#define BLINK_INTERVAL_MS 500
#define STALE_MSG_THRESHOLD_S 600
#define NTP_SYNC_INTERVAL_MS 3600000
#define WAKE_DISPLAY_MS 5000
#define TOUCH_DEBOUNCE_MS 300
#define HOLD_DURATION_MS 2000
#define HEARTBEAT_INTERVAL_MS 30000
#if DEBUG_MODE
#define BOOT_GRACE_MS 5000
#else
#define BOOT_GRACE_MS 30000
#endif
// =====================================================================
// Hardware pins are now in boards/board_*.h via BoardConfig.h
// Screen dimensions (SCREEN_WIDTH, SCREEN_HEIGHT) also come from there.
// =====================================================================