show stack depth

This commit is contained in:
2025-07-18 20:31:23 +01:00
parent 82fed85229
commit 46cb2886f2

View File

@@ -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<f32, 3, 5, u8>;
pub const STACK_DEPTH: usize = 7;
type Calc = StackCalc<f32, STACK_DEPTH, 5, u8>;
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(),
}