mirror of
https://github.com/Anshorei/epd-waveshare.git
synced 2026-10-03 22:06:43 +00:00
Use data_x_times instead of big u8-slice
This commit is contained in:
+2
-5
@@ -200,11 +200,8 @@ where
|
|||||||
let color = self.background_color.get_byte_value();
|
let color = self.background_color.get_byte_value();
|
||||||
|
|
||||||
//TODO: this is using a big buffer atm, is it better to just loop over sending a single byte?
|
//TODO: this is using a big buffer atm, is it better to just loop over sending a single byte?
|
||||||
self.interface.cmd_with_data(
|
self.interface.cmd(spi, Command::WRITE_RAM)?;
|
||||||
spi,
|
self.interface.data_x_times(spi, color, WIDTH / 8 * HEIGHT)
|
||||||
Command::WRITE_RAM,
|
|
||||||
&[color; WIDTH as usize / 8 * HEIGHT as usize]
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_background_color(&mut self, background_color: Color) {
|
fn set_background_color(&mut self, background_color: Color) {
|
||||||
|
|||||||
Reference in New Issue
Block a user