error display with -E-
This commit is contained in:
@@ -83,17 +83,19 @@ impl SegmentPins {
|
||||
|
||||
#[derive(Clone, Copy, PartialEq, Eq)]
|
||||
pub enum SegmentState {
|
||||
Off,
|
||||
Num(u8, bool),
|
||||
Minus,
|
||||
Prompt(bool),
|
||||
Dot,
|
||||
Off,
|
||||
E,
|
||||
}
|
||||
|
||||
impl SegmentState {
|
||||
pub fn apply(&self, seg: &mut SegmentPins) {
|
||||
seg.set_off();
|
||||
match self {
|
||||
SegmentState::Off => (),
|
||||
SegmentState::Num(no, dp) => {
|
||||
match no {
|
||||
0 => {
|
||||
@@ -179,7 +181,13 @@ impl SegmentState {
|
||||
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) {
|
||||
self.set([
|
||||
SegmentState::Off,
|
||||
SegmentState::Off,
|
||||
SegmentState::Off,
|
||||
SegmentState::Minus,
|
||||
SegmentState::E,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Minus,
|
||||
SegmentState::Off,
|
||||
SegmentState::Off,
|
||||
SegmentState::Off,
|
||||
])
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user