From 0ea442d68deee51a424bf3348d5b42cd96049f42 Mon Sep 17 00:00:00 2001 From: Me Here Date: Sun, 31 May 2026 23:48:50 -0500 Subject: [PATCH] pm-kit: draw the real metronome screen on the panel (static sample data) Switch the firmware from the bring-up diagnostic to pm_ui::draw_metronome with static borrowed lane data (no allocator yet). Shows the actual metronome UI on the device; live track + moving playhead come when pm-core is linked. Co-Authored-By: Claude Opus 4.8 (1M context) --- rust/pm-kit/src/main.rs | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/rust/pm-kit/src/main.rs b/rust/pm-kit/src/main.rs index 5082c7d..b3a1851 100644 --- a/rust/pm-kit/src/main.rs +++ b/rust/pm-kit/src/main.rs @@ -133,8 +133,23 @@ fn main() -> ! { .init(&mut timer) .unwrap(); - // Same UI code the host simulator renders (rust/uisim → PNG). - pm_ui::draw_ui(&mut display).unwrap(); + // The real metronome screen the host simulator renders (rust/uisim → PNG). Static sample data + // for now (no allocator needed — draw_metronome takes borrowed slices); the live track + a + // moving playhead come once pm-core is linked in. + let kick = [2u8, 1, 1, 1]; + let snare = [0u8, 1, 0, 1]; + let hat = [2u8, 1, 1, 1, 1, 1, 1, 1]; + let ride = [2u8, 0, 1, 0, 1, 0, 1, 0]; + let cow = [2u8, 1, 1]; + let lanes = [ + pm_ui::LaneView { name: "kick", levels: &kick, beats: 4, poly: false, muted: false }, + pm_ui::LaneView { name: "snare", levels: &snare, beats: 4, poly: false, muted: false }, + pm_ui::LaneView { name: "hatClosed", levels: &hat, beats: 4, poly: false, muted: false }, + pm_ui::LaneView { name: "ride", levels: &ride, beats: 4, poly: false, muted: false }, + pm_ui::LaneView { name: "cowbell", levels: &cow, beats: 3, poly: true, muted: false }, + ]; + let screen = pm_ui::Screen { name: "Four-on-the-floor", bpm: 128, playing: true, phase: 0.30, lanes: &lanes }; + pm_ui::draw_metronome(&mut display, &screen).unwrap(); // Reached the loop → display init + draw completed. Slow 1 Hz blink (vs the solid-ON during // init above) so "hung in init" / "running" / "reset loop" are distinguishable on the LED.