Browse Source

Fix: Timing Issues after display_frame

epd1in54 and epd2in9 were both missing a necessary wait_until_idle call at the end of their display_frame function which sometimes caused invalid/ignored commands/inputs afterwards.
embedded-hal-1.0
Chris 7 years ago
parent
commit
63321f7e2c
  1. 5
      src/epd1in54/mod.rs
  2. 5
      src/epd2in9/mod.rs
  3. 2
      src/traits.rs

5
src/epd1in54/mod.rs

@ -217,7 +217,10 @@ where
self.interface.cmd(spi, Command::MASTER_ACTIVATION)?;
// MASTER Activation should not be interupted to avoid currption of panel images
// therefore a terminate command is send
self.interface.cmd(spi, Command::NOP)
self.interface.cmd(spi, Command::NOP)?;
self.wait_until_idle();
Ok(())
}
fn clear_frame(&mut self, spi: &mut SPI) -> Result<(), SPI::Error> {

5
src/epd2in9/mod.rs

@ -216,7 +216,10 @@ where
self.interface.cmd(spi, Command::MASTER_ACTIVATION)?;
// MASTER Activation should not be interupted to avoid currption of panel images
// therefore a terminate command is send
self.interface.cmd(spi, Command::NOP)
self.interface.cmd(spi, Command::NOP)?;
self.wait_until_idle();
Ok(())
}
fn clear_frame(&mut self, spi: &mut SPI) -> Result<(), SPI::Error> {

2
src/traits.rs

@ -123,6 +123,8 @@ where
) -> Result<(), SPI::Error>;
/// Displays the frame data from SRAM
///
/// This function waits until the device isn`t busy anymore
fn display_frame(&mut self, spi: &mut SPI) -> Result<(), SPI::Error>;
/// Clears the frame buffer on the EPD with the declared background color

Loading…
Cancel
Save