From 5bcf4c4e0d42c3f4b2759d7cbd2d4165639eee49 Mon Sep 17 00:00:00 2001 From: Gabriel Kaszewski Date: Fri, 19 Jun 2026 13:22:12 +0200 Subject: [PATCH] strip unused esp32 deps, fix render loop power waste --- crates/client-esp32/Cargo.toml | 8 -------- crates/client-esp32/src/boot/logo.rs | 6 ------ crates/client-esp32/src/tasks/render.rs | 3 ++- 3 files changed, 2 insertions(+), 15 deletions(-) diff --git a/crates/client-esp32/Cargo.toml b/crates/client-esp32/Cargo.toml index 7214abc..b6f1aaa 100644 --- a/crates/client-esp32/Cargo.toml +++ b/crates/client-esp32/Cargo.toml @@ -15,14 +15,6 @@ esp-idf-sys = "0.37" mipidsi = "0.10" embedded-graphics = "0.8" -embedded-text = "0.7" -embedded-hal-bus = "0.3" - -serde = { version = "1.0", default-features = false, features = [ - "derive", - "alloc", -] } -postcard = { version = "1.1", default-features = false, features = ["alloc"] } log = "0.4" diff --git a/crates/client-esp32/src/boot/logo.rs b/crates/client-esp32/src/boot/logo.rs index 21319d3..b440e6b 100644 --- a/crates/client-esp32/src/boot/logo.rs +++ b/crates/client-esp32/src/boot/logo.rs @@ -41,12 +41,6 @@ fn fill_triangles>( } } -// Outer hexagon vertices (150x150 viewBox) -const OUTER_HEX: [(f32, f32); 6] = [ - (75.0, 0.0), (150.0, 37.5), (150.0, 112.5), - (75.0, 150.0), (0.0, 112.5), (0.0, 37.5), -]; - // Converted from SVG: (150,75)(112.5,150)(37.5,150)(0,75)(37.5,0)(112.5,0) // Reordered to start from top for cleaner fan const OUTER_HEX_SVG: [(f32, f32); 6] = [ diff --git a/crates/client-esp32/src/tasks/render.rs b/crates/client-esp32/src/tasks/render.rs index f62b4ac..f9c0adc 100644 --- a/crates/client-esp32/src/tasks/render.rs +++ b/crates/client-esp32/src/tasks/render.rs @@ -47,7 +47,8 @@ pub fn run( display.flush().unwrap(); loop { - let timeout = RENDER_POLL_INTERVAL.min(SCROLL_TICK); + let has_scrollers = widgets.values().any(|c| c.scroll.is_active()); + let timeout = if has_scrollers { SCROLL_TICK } else { RENDER_POLL_INTERVAL }; match rx.recv_timeout(timeout) { Ok(RenderEvent::ConnectionStatus(status)) => { if status != connected {