mirror of
https://github.com/Anshorei/epd-waveshare.git
synced 2026-10-03 22:06:43 +00:00
Edition 2018 (#24)
* "cargo fix --edition" for the library * Switch to 2018 edition * Use cargo fix edition-idioms and remove the internal renaming from embedded_hal to hal * Updated Readme * run cargo fmt
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
//! SPI Commands for the Waveshare 4.2" E-Ink Display
|
||||
use traits;
|
||||
use crate::traits;
|
||||
/// EPD4IN2 commands
|
||||
///
|
||||
/// Should rarely (never?) be needed directly.
|
||||
@@ -165,7 +165,7 @@ impl traits::Command for Command {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use traits::Command as CommandTrait;
|
||||
use crate::traits::Command as CommandTrait;
|
||||
|
||||
#[test]
|
||||
fn command_addr() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use color::Color;
|
||||
use crate::color::Color;
|
||||
|
||||
pub const WIDTH: u32 = 400;
|
||||
pub const HEIGHT: u32 = 300;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use epd4in2::constants::{DEFAULT_BACKGROUND_COLOR, HEIGHT, WIDTH};
|
||||
use crate::epd4in2::constants::{DEFAULT_BACKGROUND_COLOR, HEIGHT, WIDTH};
|
||||
|
||||
/// Full size buffer for use with the 4in2 EPD
|
||||
///
|
||||
@@ -20,12 +20,12 @@ impl Default for Buffer4in2 {
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
use color::Color;
|
||||
use crate::color::Color;
|
||||
use crate::epd4in2;
|
||||
use crate::graphics::{Display, DisplayRotation};
|
||||
use embedded_graphics::coord::Coord;
|
||||
use embedded_graphics::prelude::*;
|
||||
use embedded_graphics::primitives::Line;
|
||||
use epd4in2;
|
||||
use graphics::{Display, DisplayRotation};
|
||||
|
||||
// test buffer length
|
||||
#[test]
|
||||
@@ -40,7 +40,7 @@ mod tests {
|
||||
fn graphics_default() {
|
||||
let mut display4in2 = Buffer4in2::default();
|
||||
let display = Display::new(WIDTH, HEIGHT, &mut display4in2.buffer);
|
||||
use epd4in2;
|
||||
use crate::epd4in2;
|
||||
for &byte in display.buffer() {
|
||||
assert_eq!(
|
||||
byte,
|
||||
|
||||
+4
-4
@@ -46,19 +46,19 @@
|
||||
//!
|
||||
//! BE CAREFUL! The screen can get ghosting/burn-ins through the Partial Fast Update Drawing.
|
||||
|
||||
use hal::{
|
||||
use embedded_hal::{
|
||||
blocking::{delay::*, spi::Write},
|
||||
digital::*,
|
||||
};
|
||||
|
||||
use interface::DisplayInterface;
|
||||
use traits::{InternalWiAdditions, RefreshLUT, WaveshareDisplay};
|
||||
use crate::interface::DisplayInterface;
|
||||
use crate::traits::{InternalWiAdditions, RefreshLUT, WaveshareDisplay};
|
||||
|
||||
//The Lookup Tables for the Display
|
||||
mod constants;
|
||||
pub use self::constants::*;
|
||||
|
||||
use color::Color;
|
||||
use crate::color::Color;
|
||||
|
||||
pub(crate) mod command;
|
||||
use self::command::Command;
|
||||
|
||||
Reference in New Issue
Block a user