fw-rust: Remove clear() function for LCD
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful

Use `fill_area()` instead of `clear()` to clear the the display.
This commit is contained in:
finga 2022-03-22 17:36:09 +01:00
parent 08a371062d
commit 63cc1c9d0f

View file

@ -69,26 +69,6 @@ impl Lcd {
block!(self.spi.send(0xB0 + page)).unwrap();
}
fn clear(&mut self) {
let mut delay = Delay::<MHz8>::new();
for page in 0..8 {
self.move_cursor(0, page as u8);
// TODO: This delay fixes issues, try find a better solution
delay.delay_ms(1_u8);
self.cd.set_high();
for _ in 0..102 {
block!(self.spi.send(0x00)).unwrap();
}
// TODO: This delay fixes issues, try find a better solution
delay.delay_ms(1_u8);
self.cd.set_low();
}
}
fn fill(&mut self, segment: u8, page: u8, width: u8, data: u8) {
assert!(segment + width <= 102);
let mut delay = Delay::<MHz8>::new();
@ -203,7 +183,7 @@ impl Lcd {
pub fn draw(&mut self, screen: &Screens) {
interrupt::free(|_cs| {
self.clear();
self.fill_area(0, 0, 102, 8, 0x00);
match screen {
Screens::Splash(splash) => {