From 3edeac413dc6e1621de9e32f26b60df6a00e8cd8 Mon Sep 17 00:00:00 2001 From: Christian Meusel Date: Wed, 14 Jul 2021 23:06:29 +0200 Subject: [PATCH] Provide full QuickRefresh interface for 4in2 too This display needs no special commands for displaying the new frame. But it will come in handy to support the full QuickRefresh trait when it comes to supporting different quick refresh capable displays from an application. --- src/epd4in2/mod.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/epd4in2/mod.rs b/src/epd4in2/mod.rs index 3ab7e6e..9560206 100644 --- a/src/epd4in2/mod.rs +++ b/src/epd4in2/mod.rs @@ -482,21 +482,24 @@ where Ok(()) } - /// This function is not needed for this display - #[allow(unused)] + /// This is wrapper around `display_frame` for using this device as a true + /// `QuickRefresh` device. fn display_new_frame(&mut self, spi: &mut SPI, delay: &mut DELAY) -> Result<(), SPI::Error> { - unimplemented!() + self.display_frame(spi, delay) } - /// This function is not needed for this display - #[allow(unused)] + /// This is wrapper around `update_new_frame` and `display_frame` for using + /// this device as a true `QuickRefresh` device. + /// + /// To be used immediately after `update_old_frame`. fn update_and_display_new_frame( &mut self, spi: &mut SPI, buffer: &[u8], delay: &mut DELAY, ) -> Result<(), SPI::Error> { - unimplemented!() + self.update_new_frame(spi, buffer, delay)?; + self.display_frame(spi, delay) } fn update_partial_old_frame(