From 46cb2886f28021d4e8d5b67eb52ee79c21a6b17f Mon Sep 17 00:00:00 2001 From: Hexa Dust Date: Fri, 18 Jul 2025 20:31:23 +0100 Subject: [PATCH] show stack depth --- src/main.rs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 63dc0ee..b04850c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -36,7 +36,9 @@ pub const DISPLAY_SEGMENT_SIG_MINUS: usize = 0; pub const DISPLAY_SEGMENTS_EXP: usize = 2; pub const DISPLAY_SEGMENT_EXP_MINUS: usize = 6; -type Calc = StackCalc; +pub const STACK_DEPTH: usize = 7; + +type Calc = StackCalc; struct IOSelect<'p> { display_no: usize, @@ -498,7 +500,17 @@ fn main() -> ! { } match &state.transient { - TransientState::Done => number_input.show(&mut display), + TransientState::Done => { + number_input.show(&mut display); + for seg in display + .slice(0, DISPLAY_SEGMENTS) + .iter_mut() + .rev() + .take(calc.len()) + { + seg.dp(); + } + } TransientState::Err { .. } => display.error(), }