Skip to content

Commit

Permalink
Fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
yurinnick committed Feb 1, 2023
1 parent ee81f83 commit fa83c00
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
4 changes: 2 additions & 2 deletions src/epd4in2bc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -318,8 +318,8 @@ where

self.send_data(spi, &[(x >> 8) as u8])?;
self.send_data(spi, &[(x & 0xf8) as u8])?; // x should be the multiple of 8, the last 3 bit will always be ignored
self.send_data(spi, &[((x & 0xf8) + width - 1 >> 8) as u8])?;
self.send_data(spi, &[((x & 0xf8) + width - 1 | 0x07) as u8])?;
self.send_data(spi, &[(((x & 0xf8) + width - 1) >> 8) as u8])?;
self.send_data(spi, &[(((x & 0xf8) + width - 1) | 0x07) as u8])?;

self.send_data(spi, &[(y >> 8) as u8])?;
self.send_data(spi, &[(y & 0xff) as u8])?;
Expand Down
9 changes: 2 additions & 7 deletions src/graphics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ use core::marker::PhantomData;
use embedded_graphics_core::prelude::*;

/// Display rotation, only 90° increments supported
#[derive(Clone, Copy)]
#[derive(Default, Clone, Copy)]
pub enum DisplayRotation {
/// No rotation
#[default]
Rotate0,
/// Rotate by 90 degrees clockwise
Rotate90,
Expand All @@ -17,12 +18,6 @@ pub enum DisplayRotation {
Rotate270,
}

impl Default for DisplayRotation {
fn default() -> Self {
DisplayRotation::Rotate0
}
}

/// DisplayMode carries modes avaiable for color representaion on TriColor displays
/// Each mode contains list of (bw, color) pairs, where bw - value for BW layer, color - value for Chromatic layer
#[repr(u8)]
Expand Down
9 changes: 2 additions & 7 deletions src/traits.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,16 @@ pub(crate) trait Command: Copy {
}

/// Seperates the different LUT for the Display Refresh process
#[derive(Debug, Clone, PartialEq, Eq, Copy)]
#[derive(Debug, Default, Clone, PartialEq, Eq, Copy)]
pub enum RefreshLut {
/// The "normal" full Lookuptable for the Refresh-Sequence
#[default]
Full,
/// The quick LUT where not the full refresh sequence is followed.
/// This might lead to some
Quick,
}

impl Default for RefreshLut {
fn default() -> Self {
RefreshLut::Full
}
}

pub(crate) trait InternalWiAdditions<SPI, CS, BUSY, DC, RST, DELAY>
where
SPI: Write<u8>,
Expand Down

0 comments on commit fa83c00

Please sign in to comment.