fw-rust: Remove unnecessary Draw trait
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

This commit is contained in:
finga 2022-04-02 18:35:48 +02:00
parent 9994b1fc40
commit 7f14974146
4 changed files with 6 additions and 15 deletions

View file

@ -1,4 +1,4 @@
use super::{Draw, Event, Screens, Setup, Splash}; use super::{Event, Screens, Setup, Splash};
use crate::{ use crate::{
assets::{OFF, ON, PLL_A, PLL_B}, assets::{OFF, ON, PLL_A, PLL_B},
lcd::Lcd, lcd::Lcd,
@ -93,10 +93,8 @@ impl Home {
Event::None Event::None
} }
}
impl Draw for Home { pub fn draw(&self, lcd: &mut Lcd) {
fn draw(&self, lcd: &mut Lcd) {
match &self.active { match &self.active {
Selection::Ch1 => { Selection::Ch1 => {
lcd.print_inverted(0, 0, "CH1"); lcd.print_inverted(0, 0, "CH1");

View file

@ -23,10 +23,6 @@ pub enum Event {
None, None,
} }
pub trait Draw {
fn draw(&self, lcd: &mut Lcd);
}
pub enum Screens { pub enum Screens {
Splash(Splash), Splash(Splash),
Home(Home), Home(Home),

View file

@ -1,4 +1,4 @@
use super::{Draw, Event, Home, Screens}; use super::{Event, Home, Screens};
use crate::{eeprom, lcd::Lcd, Input, BACKLIGHT, CONTRAST}; use crate::{eeprom, lcd::Lcd, Input, BACKLIGHT, CONTRAST};
enum Selection { enum Selection {
@ -106,10 +106,8 @@ impl Setup {
Event::None Event::None
} }
}
impl Draw for Setup { pub fn draw(&self, lcd: &mut Lcd) {
fn draw(&self, lcd: &mut Lcd) {
match &self.active { match &self.active {
Selection::Contrast => { Selection::Contrast => {
lcd.fill_area(0, 0, 33, 2, 0xFF); lcd.fill_area(0, 0, 33, 2, 0xFF);

View file

@ -1,4 +1,3 @@
use super::Draw;
use crate::{ use crate::{
assets::{ONDERS_ORG, SACRED_CHAO}, assets::{ONDERS_ORG, SACRED_CHAO},
lcd::Lcd, lcd::Lcd,
@ -9,8 +8,8 @@ use nb::block;
pub struct Splash; pub struct Splash;
impl Draw for Splash { impl Splash {
fn draw(&self, lcd: &mut Lcd) { pub fn draw(&self, lcd: &mut Lcd) {
let mut delay = Delay::<MHz8>::new(); let mut delay = Delay::<MHz8>::new();
for (i, page) in SACRED_CHAO.iter().enumerate() { for (i, page) in SACRED_CHAO.iter().enumerate() {