show stack depth
This commit is contained in:
16
src/main.rs
16
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_SEGMENTS_EXP: usize = 2;
|
||||||
pub const DISPLAY_SEGMENT_EXP_MINUS: usize = 6;
|
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> {
|
struct IOSelect<'p> {
|
||||||
display_no: usize,
|
display_no: usize,
|
||||||
@@ -498,7 +500,17 @@ fn main() -> ! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
match &state.transient {
|
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(),
|
TransientState::Err { .. } => display.error(),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user