All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Optimize the control data/display data slope timing. This closes #1.
44 lines
1 KiB
Rust
44 lines
1 KiB
Rust
use crate::{
|
|
assets::{ONDERS_ORG, SACRED_CHAO},
|
|
lcd::Lcd,
|
|
DefaultClock,
|
|
};
|
|
use atmega_hal::delay::Delay;
|
|
use embedded_hal::{blocking::delay::DelayUs, spi::FullDuplex};
|
|
use nb::block;
|
|
|
|
pub struct Splash;
|
|
|
|
impl Splash {
|
|
pub fn draw(&self, lcd: &mut Lcd) {
|
|
let mut delay = Delay::<DefaultClock>::new();
|
|
|
|
for (i, page) in SACRED_CHAO.iter().enumerate() {
|
|
lcd.move_cursor(31, 1 + i as u8);
|
|
|
|
delay.delay_us(5_u8);
|
|
lcd.cd.set_high();
|
|
|
|
for segment in page {
|
|
block!(lcd.spi.send(*segment)).unwrap();
|
|
}
|
|
|
|
delay.delay_us(5_u8);
|
|
lcd.cd.set_low();
|
|
}
|
|
|
|
for (i, page) in ONDERS_ORG.iter().enumerate() {
|
|
lcd.move_cursor(27, 6 + i as u8);
|
|
|
|
delay.delay_us(5_u8);
|
|
lcd.cd.set_high();
|
|
|
|
for segment in page {
|
|
block!(lcd.spi.send(*segment)).unwrap();
|
|
}
|
|
|
|
delay.delay_us(5_u8);
|
|
lcd.cd.set_low();
|
|
}
|
|
}
|
|
}
|