Ensure device is ready to receive data when updating frame

main
BuggStream 2021-02-07 01:19:30 +01:00
parent d1b0ac1854
commit 6c8ac87c7d
1 changed files with 4 additions and 0 deletions

View File

@ -99,6 +99,8 @@ where
}
fn update_achromatic_frame(&mut self, spi: &mut SPI, black: &[u8]) -> Result<(), SPI::Error> {
self.wait_until_idle();
self.interface
.cmd(spi, Command::DATA_START_TRANSMISSION_1)?;
self.interface.data(spi, black)?;
@ -110,6 +112,8 @@ where
spi: &mut SPI,
chromatic: &[u8],
) -> Result<(), SPI::Error> {
self.wait_until_idle();
self.interface
.cmd(spi, Command::DATA_START_TRANSMISSION_2)?;
self.interface.data(spi, chromatic)?;