Browse Source

Apply cargo fmt

v0.4
Christoph Grabo 3 years ago
parent
commit
4ecee29641
No known key found for this signature in database
GPG Key ID: 1FE689DF1A1AEE6C
  1. 1
      src/epd7in5_v2/command.rs
  2. 4
      src/epd7in5_v2/mod.rs
  3. 3
      src/interface.rs

1
src/epd7in5_v2/command.rs

@ -129,7 +129,6 @@ pub(crate) enum Command {
READ_VCOM_VALUE = 0x81,
/// This command sets `VCOM_DC` value.
VCM_DC_SETTING = 0x82,
// /// This is in all the Waveshare controllers for EPD7in5, but it's not documented
// /// anywhere in the datasheet `¯\_(ツ)_/¯`
// FLASH_MODE = 0xE5,

4
src/epd7in5_v2/mod.rs

@ -217,7 +217,9 @@ where
{
fn update_and_display_frame(&mut self, spi: &mut SPI, buffer: &[u8]) -> Result<(), SPI::Error> {
self.command(spi, Command::DATA_START_TRANSMISSION_2)?;
for b in buffer { self.send_data(spi, &[255 - b])?; }
for b in buffer {
self.send_data(spi, &[255 - b])?;
}
self.command(spi, Command::DISPLAY_REFRESH)?;
self.wait_until_idle();
Ok(())

3
src/interface.rs

@ -151,7 +151,8 @@ where
/// Most likely there was a mistake with the 2in9 busy connection
/// //TODO: use the #cfg feature to make this compile the right way for the certain types
pub(crate) fn is_busy(&self, is_busy_low: bool) -> bool {
(is_busy_low && self.busy.is_low().unwrap_or(false)) || (!is_busy_low && self.busy.is_high().unwrap_or(false))
(is_busy_low && self.busy.is_low().unwrap_or(false))
|| (!is_busy_low && self.busy.is_high().unwrap_or(false))
}
/// Resets the device.

Loading…
Cancel
Save