fw-rust: Refactor printing to the LCD
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
Pass iterators for control and display data to the printing function instead of just printing it.
This commit is contained in:
parent
d73d5126dd
commit
343b95dc78
4 changed files with 127 additions and 198 deletions
|
@ -53,40 +53,40 @@ impl Home {
|
|||
pub fn draw(&self, lcd: &mut Lcd, channels: [ClockChannel; 3]) {
|
||||
match &self.active {
|
||||
Selection::Ch1 => {
|
||||
lcd.print_inverted(0, 0, "CH1");
|
||||
lcd.print(0, 0, true, "CH1");
|
||||
channels[0].print(lcd, 0);
|
||||
lcd.print(0, 2, "CH2");
|
||||
lcd.print(0, 2, false, "CH2");
|
||||
channels[1].print(lcd, 2);
|
||||
lcd.print(0, 4, "CH3");
|
||||
lcd.print(0, 4, false, "CH3");
|
||||
channels[2].print(lcd, 4);
|
||||
lcd.print(33, 6, "SETUP");
|
||||
lcd.print(33, 6, false, "SETUP");
|
||||
}
|
||||
Selection::Ch2 => {
|
||||
lcd.print(0, 0, "CH1");
|
||||
lcd.print(0, 0, false, "CH1");
|
||||
channels[0].print(lcd, 0);
|
||||
lcd.print_inverted(0, 2, "CH2");
|
||||
lcd.print(0, 2, true, "CH2");
|
||||
channels[1].print(lcd, 2);
|
||||
lcd.print(0, 4, "CH3");
|
||||
lcd.print(0, 4, false, "CH3");
|
||||
channels[2].print(lcd, 4);
|
||||
lcd.print(33, 6, "SETUP");
|
||||
lcd.print(33, 6, false, "SETUP");
|
||||
}
|
||||
Selection::Ch3 => {
|
||||
lcd.print(0, 0, "CH1");
|
||||
lcd.print(0, 0, false, "CH1");
|
||||
channels[0].print(lcd, 0);
|
||||
lcd.print(0, 2, "CH2");
|
||||
lcd.print(0, 2, false, "CH2");
|
||||
channels[1].print(lcd, 2);
|
||||
lcd.print_inverted(0, 4, "CH3");
|
||||
lcd.print(0, 4, true, "CH3");
|
||||
channels[2].print(lcd, 4);
|
||||
lcd.print(33, 6, "SETUP");
|
||||
lcd.print(33, 6, false, "SETUP");
|
||||
}
|
||||
Selection::Setup => {
|
||||
lcd.print(0, 0, "CH1");
|
||||
lcd.print(0, 0, false, "CH1");
|
||||
channels[0].print(lcd, 0);
|
||||
lcd.print(0, 2, "CH2");
|
||||
lcd.print(0, 2, false, "CH2");
|
||||
channels[1].print(lcd, 2);
|
||||
lcd.print(0, 4, "CH3");
|
||||
lcd.print(0, 4, false, "CH3");
|
||||
channels[2].print(lcd, 4);
|
||||
lcd.print_inverted(33, 6, "SETUP");
|
||||
lcd.print(33, 6, true, "SETUP");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue