From 375adf4bff8d15a45dd19ee82474b8ebaac44804 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 30 Oct 2018 15:28:34 +0100 Subject: [PATCH] Use `data_x_times` instead of big u8-slice --- src/epd2in9/mod.rs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/epd2in9/mod.rs b/src/epd2in9/mod.rs index 0383bd4..6dedc53 100644 --- a/src/epd2in9/mod.rs +++ b/src/epd2in9/mod.rs @@ -200,11 +200,8 @@ where 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? - self.interface.cmd_with_data( - spi, - Command::WRITE_RAM, - &[color; WIDTH as usize / 8 * HEIGHT as usize] - ) + self.interface.cmd(spi, Command::WRITE_RAM)?; + self.interface.data_x_times(spi, color, WIDTH / 8 * HEIGHT) } fn set_background_color(&mut self, background_color: Color) {