v0.3.2 - some timing fixes (#29)

* Fixed some missing wait_until_idle calls
* prepared release of 0.3.2
* cargo fmt

This is known to fail on travis because it uses the deprecated old digital v1 embedded hal pins
This commit is contained in:
Chris
2019-06-17 10:33:20 +02:00
committed by GitHub
parent 20fc874766
commit 7b4a7f0578
5 changed files with 76 additions and 19 deletions
+20 -5
View File
@@ -180,14 +180,20 @@ where
spi: &mut SPI,
delay: &mut DELAY,
) -> Result<(), SPI::Error> {
self.init(spi, delay)
self.init(spi, delay)?;
self.wait_until_idle();
Ok(())
}
fn update_frame(&mut self, spi: &mut SPI, buffer: &[u8]) -> Result<(), SPI::Error> {
self.use_full_frame(spi)?;
self.interface
.cmd_with_data(spi, Command::WRITE_RAM, buffer)
.cmd_with_data(spi, Command::WRITE_RAM, buffer)?;
self.wait_until_idle();
Ok(())
}
//TODO: update description: last 3 bits will be ignored for width and x_pos
@@ -204,7 +210,10 @@ where
self.set_ram_counter(spi, x, y)?;
self.interface
.cmd_with_data(spi, Command::WRITE_RAM, buffer)
.cmd_with_data(spi, Command::WRITE_RAM, buffer)?;
self.wait_until_idle();
Ok(())
}
fn display_frame(&mut self, spi: &mut SPI) -> Result<(), SPI::Error> {
@@ -229,7 +238,11 @@ where
let color = self.background_color.get_byte_value();
self.interface.cmd(spi, Command::WRITE_RAM)?;
self.interface.data_x_times(spi, color, WIDTH / 8 * HEIGHT)
self.interface
.data_x_times(spi, color, WIDTH / 8 * HEIGHT)?;
self.wait_until_idle();
Ok(())
}
fn set_background_color(&mut self, background_color: Color) {
@@ -332,7 +345,9 @@ where
fn set_lut_helper(&mut self, spi: &mut SPI, buffer: &[u8]) -> Result<(), SPI::Error> {
assert!(buffer.len() == 30);
self.interface
.cmd_with_data(spi, Command::WRITE_LUT_REGISTER, buffer)
.cmd_with_data(spi, Command::WRITE_LUT_REGISTER, buffer)?;
self.wait_until_idle();
Ok(())
}
}