upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/main/tollgate_main.c
diff options
context:
space:
mode:
authorYour Name <you@example.com>2026-05-18 19:25:32 +0530
committerYour Name <you@example.com>2026-05-18 19:25:32 +0530
commite1da6ffc0221abf4d0fb3a8c3e6be0b90d69397a (patch)
tree3a0055b5af2bb09492c8c38fdf2712922ecc7123 /main/tollgate_main.c
parentf0f8cca10196b265c3b453f71322239d2ecaf4ae (diff)
Implement full TollGate display UI
- BOOT screen: centered title + WiFi status line - READY screen: QR cycling (WiFi/Portal), price, mint domain, wallet balance (color-coded), client count - PAYMENT screen: green banner 'ACCESS GRANTED', paid amount, time - ERROR screen: red banner 'NO UPSTREAM', guidance, AP reassurance - Enhanced display_update() API with mint_url, price, wifi_status - Extract domain helper for clean mint URL display - Render interval: 2s (reduced SPI load) - Color palette: cyan, yellow, orange, green, red, dim gray - WiFi events update display status and trigger ERROR state - Board C now on /dev/ttyACM3
Diffstat (limited to 'main/tollgate_main.c')
-rw-r--r--main/tollgate_main.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/main/tollgate_main.c b/main/tollgate_main.c
index c0ff65f..7fd50ad 100644
--- a/main/tollgate_main.c
+++ b/main/tollgate_main.c
@@ -54,7 +54,11 @@ static void wifi_event_handler(void *arg, esp_event_base_t event_base,
54 s_retry_count++; 54 s_retry_count++;
55 ESP_LOGW(TAG, "WiFi disconnected, retry %d/%d", s_retry_count, MAX_STA_RETRY); 55 ESP_LOGW(TAG, "WiFi disconnected, retry %d/%d", s_retry_count, MAX_STA_RETRY);
56 tollgate_client_on_sta_disconnected(); 56 tollgate_client_on_sta_disconnected();
57 if (s_services_running) stop_services(); 57 if (s_services_running) {
58 stop_services();
59 display_set_state(DISPLAY_ERROR);
60 }
61 display_update(NULL, 0, 0, NULL, NULL, 0, "WiFi retry...");
58 if (s_retry_count < MAX_STA_RETRY) { 62 if (s_retry_count < MAX_STA_RETRY) {
59 esp_wifi_connect(); 63 esp_wifi_connect();
60 } else { 64 } else {
@@ -173,7 +177,8 @@ static void start_services(void)
173 display_set_state(DISPLAY_READY); 177 display_set_state(DISPLAY_READY);
174 char portal_url[128]; 178 char portal_url[128];
175 snprintf(portal_url, sizeof(portal_url), "http://%s/", cfg->ap_ip_str); 179 snprintf(portal_url, sizeof(portal_url), "http://%s/", cfg->ap_ip_str);
176 display_update(cfg->ap_ssid, 0, 0, portal_url); 180 display_update(cfg->ap_ssid, 0, 0, portal_url,
181 cfg->mint_url, cfg->price_per_step, NULL);
177} 182}
178 183
179static void stop_services(void) 184static void stop_services(void)