Files
pictureFrame/firmware/src/config.h
T
football2801 dd0970ed7c fix: harden firmware NVS persistence, WDT, and 304 epd_sleep
Three bugs fixed:
- NVS img_id now written before epd_init/draw; new draw_needed flag in NVS
  survives power-loss mid-refresh so next boot re-draws from LittleFS instead
  of showing stale content
- epd_sleep() now only called when display was initialized this cycle,
  preventing a 60 s wait_busy() timeout on every 304 poll
- esp_task_wdt_reset() added to wait_busy() loop so the ~20 s 6-color
  refresh no longer triggers the task watchdog

Also extracts normal_operation into operation.h template and adds
a native PlatformIO test suite (16 tests) covering the full response matrix.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-06 12:09:37 -04:00

41 lines
1.8 KiB
C

#pragma once
// ── EPD pins (Waveshare 7.3" ACeP) ──────────────────────────────────────────
#define EPD_WIDTH 800
#define EPD_HEIGHT 480
#define PIN_SCK 18
#define PIN_MOSI 23
#define PIN_CS 5
#define PIN_DC 17
#define PIN_RST 16
#define PIN_BUSY 4
// ── Reset button (BOOT button = GPIO 0 on most dev boards) ──────────────────
#define PIN_BTN_RESET 0
#define RESET_HOLD_MS 5000
// ── EPD color nibbles ────────────────────────────────────────────────────────
// Verified on Waveshare 7.3" hardware. Same map on 13.3" Spectra 6.
#define COLOR_BLACK 0x0
#define COLOR_WHITE 0x1
#define COLOR_YELLOW 0x2
#define COLOR_RED 0x3
#define COLOR_BLUE 0x5
#define COLOR_GREEN 0x6
// ── NVS ──────────────────────────────────────────────────────────────────────
#define NVS_NAMESPACE "pf"
#define NVS_KEY_SSID "ssid"
#define NVS_KEY_PASS "pass"
#define NVS_KEY_IMG_ID "img_id"
#define NVS_KEY_DRAW_NEEDED "draw"
// ── Network ──────────────────────────────────────────────────────────────────
#define APP_BASE_URL "https://pictureframe.edholm.me"
#define AP_IP "192.168.4.1"
#define WIFI_TIMEOUT_MS 30000
#ifndef FETCH_INTERVAL_MS
#define FETCH_INTERVAL_MS 60000 // 1 min deep sleep between polls
#endif
#define IMAGE_PATH "/img.bin"