firmware: Streamline writing to display
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
Move if condition inside the SPI call to reduce duplicate code.
This commit is contained in:
parent
59ff782d52
commit
c26ba3549a
1 changed files with 1 additions and 5 deletions
|
@ -35,11 +35,7 @@ impl Lcd {
|
||||||
delay.delay_us(5_u8);
|
delay.delay_us(5_u8);
|
||||||
self.cd.set_high();
|
self.cd.set_high();
|
||||||
|
|
||||||
if invert {
|
data.for_each(|d| block!(self.spi.send(if invert { !*d } else { *d })).unwrap());
|
||||||
data.for_each(|d| block!(self.spi.send(!*d)).unwrap());
|
|
||||||
} else {
|
|
||||||
data.for_each(|d| block!(self.spi.send(*d)).unwrap());
|
|
||||||
}
|
|
||||||
|
|
||||||
delay.delay_us(5_u8);
|
delay.delay_us(5_u8);
|
||||||
self.cd.set_low();
|
self.cd.set_low();
|
||||||
|
|
Loading…
Reference in a new issue