From 333edf10f05a7deafdf307363aaa08828e11a533 Mon Sep 17 00:00:00 2001 From: Eric Trombly Date: Wed, 26 Feb 2020 11:39:39 -0600 Subject: [PATCH] update to hal v2 traits --- Cargo.toml | 10 +++++----- src/graphics.rs | 2 +- src/interface.rs | 21 ++++++++++++--------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 1161575..71c8490 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -18,23 +18,23 @@ travis-ci = { repository = "wezm/ssd1675" } codecov = { repository = "wezm/ssd1675" } [dependencies] -libm = "0.1.2" +libm = "0.2.1" [dependencies.embedded-hal] features = ["unproven"] -version = "0.2.2" +version = "0.2.3" [dependencies.embedded-graphics] optional = true -version = "0.4.4" +version = "0.5.2" [dependencies.linux-embedded-hal] optional = true -version = "0.2.1" +version = "0.3.0" [dependencies.profont] optional = true -version = "0.1" +version = "0.3.0" [features] default = ["graphics"] diff --git a/src/graphics.rs b/src/graphics.rs index 7b1a84e..0ce08f0 100644 --- a/src/graphics.rs +++ b/src/graphics.rs @@ -153,7 +153,7 @@ where { fn draw(&mut self, item_pixels: T) where - T: Iterator>, + T: IntoIterator>, { for Pixel(UnsignedCoord(x, y), colour) in item_pixels { if outside_display( diff --git a/src/interface.rs b/src/interface.rs index fc78ee0..d56fc89 100644 --- a/src/interface.rs +++ b/src/interface.rs @@ -96,10 +96,10 @@ pub struct Interface { impl Interface where SPI: hal::blocking::spi::Write, - CS: hal::digital::OutputPin, - BUSY: hal::digital::InputPin, - DC: hal::digital::OutputPin, - RESET: hal::digital::OutputPin, + CS: hal::digital::v2::OutputPin, + BUSY: hal::digital::v2::InputPin, + DC: hal::digital::v2::OutputPin, + RESET: hal::digital::v2::OutputPin, { /// Create a new Interface from embedded hal traits. pub fn new(spi: SPI, cs: CS, busy: BUSY, dc: DC, reset: RESET) -> Self { @@ -136,10 +136,10 @@ where impl DisplayInterface for Interface where SPI: hal::blocking::spi::Write, - CS: hal::digital::OutputPin, - BUSY: hal::digital::InputPin, - DC: hal::digital::OutputPin, - RESET: hal::digital::OutputPin, + CS: hal::digital::v2::OutputPin, + BUSY: hal::digital::v2::InputPin, + DC: hal::digital::v2::OutputPin, + RESET: hal::digital::v2::OutputPin, { type Error = SPI::Error; @@ -164,6 +164,9 @@ where } fn busy_wait(&self) { - while self.busy.is_high() {} + while match self.busy.is_high() { + Ok(x) => x, + _ => false, + } {} } }