error display with -E-

This commit is contained in:
2025-07-18 20:31:23 +01:00
parent ae4e558b52
commit ca52fa9b14

View File

@@ -83,17 +83,19 @@ impl SegmentPins {
#[derive(Clone, Copy, PartialEq, Eq)] #[derive(Clone, Copy, PartialEq, Eq)]
pub enum SegmentState { pub enum SegmentState {
Off,
Num(u8, bool), Num(u8, bool),
Minus, Minus,
Prompt(bool), Prompt(bool),
Dot, Dot,
Off, E,
} }
impl SegmentState { impl SegmentState {
pub fn apply(&self, seg: &mut SegmentPins) { pub fn apply(&self, seg: &mut SegmentPins) {
seg.set_off(); seg.set_off();
match self { match self {
SegmentState::Off => (),
SegmentState::Num(no, dp) => { SegmentState::Num(no, dp) => {
match no { match no {
0 => { 0 => {
@@ -179,7 +181,13 @@ impl SegmentState {
seg.set_dp() seg.set_dp()
} }
} }
SegmentState::Off => (), SegmentState::E => {
seg.set_a();
seg.set_d();
seg.set_e();
seg.set_f();
seg.set_g();
}
} }
} }
} }
@@ -251,15 +259,15 @@ impl DispalyState {
pub fn error(&mut self) { pub fn error(&mut self) {
self.set([ self.set([
SegmentState::Off,
SegmentState::Off,
SegmentState::Off,
SegmentState::Minus, SegmentState::Minus,
SegmentState::E,
SegmentState::Minus, SegmentState::Minus,
SegmentState::Minus, SegmentState::Off,
SegmentState::Minus, SegmentState::Off,
SegmentState::Minus, SegmentState::Off,
SegmentState::Minus,
SegmentState::Minus,
SegmentState::Minus,
SegmentState::Minus,
]) ])
} }
} }