pm-kit: isolation step 2 — heap init only (16KB), no parse, draw_ui

If blue → the 96KB heap memory was colliding (stack/buffer). If still black → the
allocator's presence itself. Narrowing the heap/display interaction.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
Me Here 2026-06-01 08:16:46 -05:00
parent 9e2e833485
commit 7faca6d0d7

View file

@ -59,7 +59,7 @@ fn main() -> ! {
// heap for track parsing (track-format uses alloc). RP2350 has 520 KB SRAM.
{
use core::mem::MaybeUninit;
const HEAP_SIZE: usize = 96 * 1024;
const HEAP_SIZE: usize = 16 * 1024;
static mut HEAP_MEM: [MaybeUninit<u8>; HEAP_SIZE] = [MaybeUninit::uninit(); HEAP_SIZE];
unsafe { HEAP.init(core::ptr::addr_of_mut!(HEAP_MEM) as usize, HEAP_SIZE) }
}
@ -155,7 +155,7 @@ fn main() -> ! {
// confirmed-working pattern in a loop. No inputs/audio/clock. If the screen shows blue +
// corners → heap + parse + display are all fine and the bug is in the metronome loop logic.
// If still black → the heap/parse path breaks the display.
let _t = track_format::parse("t120;kick:4=Xxxx;snare:4=.X.X");
// (parse removed for this test — heap init only)
let mut hb = false;
let mut hb_us = 0u64;
led.set_low().unwrap();