Commit Graph

77 Commits

Author SHA1 Message Date
05f6a7edf6 consolidate sketches 2026-02-16 19:08:47 -08:00
d8febf3b50 update arduinojson 2026-02-16 19:08:47 -08:00
6f0611c3bd move to new multi-board setup 2026-02-16 19:08:47 -08:00
2d0427604c Fix ESP32-S3 LCD timing, add diagnostics, scaffold script
1. **Display timing fixes for ESP32-S3-LCD-4.3**
   - Corrected RGB panel timing parameters (hsync/vsync porch values)
   - **Critical fix**: Set `pclk_active_neg = 1` (required for ST7262 panel)
   - Added explicit PCLK speed of 16MHz
   - These changes fix the blank/unstable display issue on Waveshare 4.3" boards

2. **Added memory diagnostics**
   - Prints free heap and PSRAM at boot
   - Helps verify PSRAM is properly initialized

3. **Duplicate loop() function**
   - The `loop()` function appears twice in the .ino file
   - Contains identical code for touch handling, hold-to-silence, and serial commands
   - This is a build error waiting to happen

4. **New scaffold script**
   - Added comprehensive project scaffolding script (`scaffold.sh`)
   - Generates complete multi-target build structure with shared library and per-board drivers

- **ESP32-S3-LCD-4.3 board should now display correctly** (was likely blank before due to wrong timing)
- **Build will fail** due to duplicate `loop()` definition - needs immediate cleanup
- The scaffold script enables rapid project regeneration/setup for new installations
2026-02-16 19:08:47 -08:00
f82dd35e1d fix: correct Waveshare touch pins, banner, test fills
- 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
2026-02-16 19:08:47 -08:00
ab1fcc55b4 Code formatting improvement in the display initialization function
**Code formatting improvement** in the display initialization function:
- Reformatted a compressed one-liner containing RGB screen test code into properly structured, readable lines
- Split the color test sequence (RED → GREEN → BLUE) across multiple lines with preserved comments and delays

- **No functional changes** - the code behavior remains identical
- **Improved readability** - the color test sequence is now easier to understand and maintain
- **Better debugging** - individual test steps are clearly visible, making it easier to modify or troubleshoot the display initialization routine
2026-02-16 19:08:47 -08:00
1c06dbaccb Added RGB color test sequence commented out in the display initialization code
Added RGB color test sequence commented out in the display initialization code:
- Red screen fill (0xF800)
- Green screen fill (0x07E0)
- Blue screen fill (0x001F)
- 2-second delays between each color

**Currently:** No functional impact - the test code is commented out, so it doesn't execute.

**If uncommented:** Would add a 6-second RGB test pattern on display startup, useful for verifying:
- Display color channel functionality
- Proper RGB565 color format support
- Screen initialization success

This appears to be debug/diagnostic code left in for future troubleshooting.
2026-02-16 19:08:47 -08:00
124a14351b fix: correct Waveshare touch pins (17/18/38), dynamic banner
- TOUCH_SDA=17, TOUCH_SCL=18, TOUCH_RST=38 per Waveshare schematic
- GPIO 8/9 were conflicting with LCD_B0/B3, blanking the display
- Boot banner now uses BOARD_NAME macro from BoardConfig.h
2026-02-16 19:08:47 -08:00
9c34a39a39 fix: correct Waveshare touch pins — SDA=17 SCL=18 RST=38
GPIO 8/9 were assigned to both LCD blue data and I2C touch,
causing I2C init to steal the LCD pins and blank the display.
Corrected to match Waveshare ESP32-S3-Touch-LCD-4.3 schematic.
2026-02-16 19:08:47 -08:00
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
35016940b5 fix: use compiler.cpp.extra_flags to avoid clobbering platform defines
build.extra_flags replaces the esp32 core's platform-level flags,
which include CONFIG_IDF_TARGET_ESP32S3 — required by Arduino_GFX
for RGB panel support. compiler.cpp.extra_flags appends safely.
2026-02-16 19:05:13 -08:00
6d45dae9c9 fix: add missing #include <Arduino.h> to GFX/GT911 drivers
Required for uint16_t, Serial, millis() etc. when compiling
outside the .ino (Arduino IDE auto-includes Arduino.h for .ino
files but not for standalone .cpp files).
2026-02-16 19:05:13 -08:00
8508442682 fix: define silenceAlerts() before loop() 2026-02-16 19:05:13 -08:00
4f31b4aff2 fix: define silenceAlerts() — was called but never written
Restores the original behavior from before commit 46b0cb9:
delegates to logic.onTouch() which transitions state to SILENT.

This was a pre-existing bug (undefined function) exposed by the
multi-target refactoring changing compile guard structure.
2026-02-16 19:05:13 -08:00
087b639e71 fix: make .ino compile guard target-aware
ST7796_DRIVER check only fires when USE_TFT_ESPI is active.
Waveshare (Arduino_GFX) path skips this check entirely.
2026-02-16 19:05:13 -08:00
414e5dcc3f build: multi-target mise.toml with BOARD_TARGET env var
Usage:
  mise run compile                              # default (e32r35t)
  BOARD_TARGET=waveshare_s3 mise run compile    # Waveshare 4.3"
  BOARD_TARGET=e32r35t mise run all             # build + upload + monitor
  BOARD_TARGET=waveshare_s3 mise run install-libs  # install target-specific libs

Each target gets its own FQBN, build flags, library set, and port detection.
2026-02-16 19:05:13 -08:00
348612d9cd refactor: abstract hardware in DisplayManager
- TFT_eSPI -> Gfx typedef (zero-cost on E32R35T)
- Touch reads wrapped in #if USE_TOUCH_XPT2046 / USE_TOUCH_GT911
- Hardcoded rotation -> DISPLAY_ROTATION from BoardConfig
- All 480/320 literals -> SCREEN_WIDTH / SCREEN_HEIGHT
- Boot splash shows BOARD_NAME for target identification
- Added holdProgress() convenience method using HOLD_DURATION_MS
2026-02-16 19:05:13 -08:00
d0ab4a8da7 refactor: parameterize Dashboard for multi-target
- TFT_eSPI / TFT_eSprite -> Gfx / GfxSprite typedefs
- Hard-coded 480x320 -> SCREEN_WIDTH / SCREEN_HEIGHT from BoardConfig
- Top bar, WiFi bars, time position all scale to any resolution
- Zero behavioral change on E32R35T (Gfx = TFT_eSPI typedef)
2026-02-16 19:05:13 -08:00
259a26e79e feat: add touch driver abstraction layer
XPT2046 path: no change — uses TFT_eSPI built-in getTouch().
GT911 path:   TouchDriver namespace with begin()/read() stub.

TouchDriverGT911.cpp compiles to nothing on TFT_eSPI targets.
Uncomment TAMC_GT911 lines to enable real capacitive touch.
2026-02-16 19:05:13 -08:00
50f7b5c390 feat: add display driver abstraction layer
Gfx / GfxSprite types:
  - TFT_eSPI path: zero-cost typedefs to TFT_eSPI / TFT_eSprite
  - Arduino_GFX path: adapter classes with TFT_eSPI-compatible API

DisplayDriverGFX.cpp compiles to nothing on TFT_eSPI targets.
GfxSprite on Arduino_GFX uses direct-draw (no offscreen buffer yet).
2026-02-16 19:05:13 -08:00
1b87815011 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 19:05:13 -08:00
5313222f4f snapshot 2026-02-16 19:05:13 -08:00
7763aadf51 snapshot 2026-02-16 19:05:13 -08:00
d3f5a4e3e3 snapshot 2026-02-16 19:05:13 -08:00
850275ee03 snapshot 2026-02-16 19:05:13 -08:00
3e62c7d481 implement dashboard on wake 2026-02-16 19:05:13 -08:00
e24d19eb94 snapshot 2026-02-16 19:05:13 -08:00
cc081ebc1a snapshot 2026-02-16 19:05:13 -08:00
24f69e8589 snapshot 2026-02-16 19:05:13 -08:00
83002ff8b2 snapshot 2026-02-16 19:05:13 -08:00
e16d7b62f6 snapshot 2026-02-16 19:05:13 -08:00
030dbe86d3 snapshot 2026-02-16 19:05:13 -08:00
3ca9465075 snapshot 2026-02-16 19:05:13 -08:00
9b9fb6dfb2 snapshot 2026-02-16 19:05:13 -08:00
5b09c14d42 snapshot 2026-02-16 19:05:13 -08:00
f4045cdb98 snapshot 2026-02-16 19:05:13 -08:00
fadcb684cc snapshot 2026-02-16 19:05:13 -08:00
b3f1f0e805 add tft fork to doorbell sketch 2026-02-16 19:05:13 -08:00
3e4effd509 snapshot 2026-02-16 19:05:13 -08:00
dc1a8f9768 snapshot 2026-02-16 19:05:13 -08:00
6823b0ac21 snapshot 2026-02-16 19:05:13 -08:00
09252ca585 networking broken 2026-02-16 19:05:13 -08:00
8be4ed3fa5 snapshot 2026-02-16 19:05:13 -08:00
b81c93ad94 snapshot 2026-02-16 19:05:13 -08:00
329690abcf snapshot 2026-02-16 19:05:12 -08:00
fbc02af589 snapshot 2026-02-16 19:05:12 -08:00
df0527b123 snapshot 2026-02-16 19:05:12 -08:00
f9c726626c snapshot 2026-02-16 19:05:12 -08:00
160c686933 snapshot 2026-02-16 19:05:12 -08:00
13812abc00 snapshot 2026-02-16 19:05:12 -08:00