Files
espresso_frame/firmware/main/status_screen.c
T
tfaour 474b92a282
Build and push server image / test (push) Successful in 45s
Firmware build check / build-check (push) Successful in 2m50s
Build and push server image / build-and-push (push) Successful in 4m36s
Build and push server image / deploy (push) Failing after 1m34s
Add server-side support for a second panel (13.3in Spectra 6 / EE02) and scaffold its firmware target
Server: Frame.panel_type (new column + migration) is auto-derived from
the device's reported board (X-Frame-Board), never user-set -- the
panel is a property of the hardware, not a picker in the UI.
image_pipeline's packing/render pipeline is parameterized by panel
geometry instead of hardcoded 800x480 globals, with the real confirmed
13.3in geometry (1600x1200) registered alongside the original 7.3in
panel. Existing 7.3in frames are unaffected (column default + board
mapping both resolve to the original panel).

Board identifiers are also renamed (devkit/xiao -> devkit_esp32c6/
xiao_esp32c6, plus new "ee02") since the EE02 board also carries a XIAO
module -- "xiao" alone stopped disambiguating hardware. The server
keeps accepting the legacy bare names indefinitely for already-flashed
devices.

Firmware: scaffolds a third build target (ee02, ESP32-S3 -- a real
chip-target change, not just a same-chip Kconfig variant like xiao) and
a new epd13in3e driver component skeleton. The actual panel init/LUT/
refresh register sequence isn't ported from vendor demo code yet (none
was available), so that component deliberately fails to compile
(#error) rather than risk sending unverified register values to real
hardware -- devkit/xiao are unaffected and build identically to before.
CI's ee02 build step is continue-on-error for the same reason.
2026-08-04 20:08:22 +00:00

71 lines
2.1 KiB
C

#include <stdlib.h>
#include <string.h>
#include "esp_check.h"
#include "epd_board.h"
#include "epd_draw.h"
#include "fonts.h"
#include "wifi_provisioning.h"
#include "status_screen.h"
static const char *TAG = "status_screen";
#define TITLE_Y 40
#define ROW1_Y 160
#define ROW2_Y 240
#define LABEL_X 80
#define MARKER_X 640
#define CHECKMARK_SIZE 40
static void draw_status_marker(uint8_t *frame, int x, int y, status_state_t state)
{
switch (state) {
case STATUS_OK:
epd_draw_checkmark(frame, x, y - 8, CHECKMARK_SIZE);
break;
case STATUS_FAILED:
epd_draw_text(frame, &Font24, "FAILED", x, y);
break;
case STATUS_PENDING:
default:
epd_draw_text(frame, &Font24, "...", x, y);
break;
}
}
esp_err_t status_screen_show(const char *wifi_ssid, status_state_t wifi_state, const char *server_addr,
status_state_t server_state)
{
/* Allocated on demand rather than statically reserved -- see
* qr_onboarding.c for why that's fine memory-budget-wise here. */
uint8_t *frame = malloc(EPD_FRAME_BYTES);
ESP_RETURN_ON_FALSE(frame != NULL, ESP_ERR_NO_MEM, TAG, "Failed to allocate frame buffer");
memset(frame, (EPD_COLOR_WHITE << 4) | EPD_COLOR_WHITE, EPD_FRAME_BYTES);
epd_draw_text_centered(frame, &Font24, "CONNECTING", EPD_WIDTH / 2, TITLE_Y);
char wifi_line[64];
snprintf(wifi_line, sizeof(wifi_line), "WIFI: %s", wifi_ssid);
epd_draw_text(frame, &Font24, wifi_line, LABEL_X, ROW1_Y);
draw_status_marker(frame, MARKER_X, ROW1_Y, wifi_state);
char server_line[96];
snprintf(server_line, sizeof(server_line), "SERVER: %s", server_addr);
epd_draw_text(frame, &Font24, server_line, LABEL_X, ROW2_Y);
draw_status_marker(frame, MARKER_X, ROW2_Y, server_state);
esp_err_t err = epd_display_buffer(frame, EPD_FRAME_BYTES);
free(frame);
if (err == ESP_OK) {
/* This just overwrote the panel with non-photo content -- the
* tracked last-displayed-photo CRC no longer describes what's
* actually on screen. */
frame_config_invalidate_last_display_crc32();
}
return err;
}