From 36723052d562613ff7d4e607dd8f62ea115a78a7 Mon Sep 17 00:00:00 2001 From: Rafael Caricio Date: Sun, 21 Jun 2020 14:02:40 +0200 Subject: [PATCH] Remove unused code --- Cargo.lock | 41 ++++++----------------------------------- Cargo.toml | 1 - src/main.rs | 21 +++++++-------------- 3 files changed, 13 insertions(+), 50 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 5a80752..4af90ff 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,12 +19,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "aligned" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d39da9b88ae1a81c03c9c082b8db83f1d0e93914126041962af61034ab44c4a5" - [[package]] name = "aligned" version = "0.3.2" @@ -172,25 +166,13 @@ dependencies = [ "vec_map", ] -[[package]] -name = "cortex-m" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0b159a1e8306949579de3698c841dba58058197b65c60807194e4fa1e7a554" -dependencies = [ - "aligned 0.2.0", - "bare-metal", - "cortex-m 0.6.2", - "volatile-register", -] - [[package]] name = "cortex-m" version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2954942fbbdd49996704e6f048ce57567c3e1a4e2dc59b41ae9fde06a01fc763" dependencies = [ - "aligned 0.3.2", + "aligned", "bare-metal", "volatile-register", ] @@ -222,7 +204,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "988624bfaeaa34565792f7badc33cd02e84ba51fff4bbc3cd76f59d4af5658e7" dependencies = [ - "cortex-m 0.6.2", + "cortex-m", "embedded-hal", ] @@ -448,7 +430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "03dcdf72cd52a1c4829905e08a90ad6f4dc0f9d15ecf1883cc74f098199aa873" dependencies = [ "cast", - "cortex-m 0.6.2", + "cortex-m", "embedded-hal", "fpa", "nb", @@ -464,7 +446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd4803f1d08e6a4c8726ae68b40cecf7c2ab05f49b1ce29af932d052cb61114c" dependencies = [ "cast", - "cortex-m 0.6.2", + "cortex-m", "embedded-hal", "nb", "nrf52-hal-common", @@ -479,7 +461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c4545414415bddd872f13c0a5418ecc380e34347a52cb048cfed38c1b0957fa" dependencies = [ "bare-metal", - "cortex-m 0.6.2", + "cortex-m", "cortex-m-rt", "vcell", ] @@ -520,7 +502,7 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" name = "pinetime-rs" version = "0.1.0" dependencies = [ - "cortex-m 0.6.2", + "cortex-m", "cortex-m-rt", "cst816s", "cstr_core", @@ -529,7 +511,6 @@ dependencies = [ "lvgl", "nrf52832-hal", "numtoa", - "shared-bus", "st7789", ] @@ -617,16 +598,6 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" -[[package]] -name = "shared-bus" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed792a53f339088822c0cc9d6ebfb950752016a288dc96ed3e302e9592f18ab0" -dependencies = [ - "cortex-m 0.5.10", - "embedded-hal", -] - [[package]] name = "shlex" version = "0.1.1" diff --git a/Cargo.toml b/Cargo.toml index 72a6982..e0f6b2d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,6 @@ embedded-graphics = "0.6" embedded-hal = {version ="0.2.3", features = ["unproven"] } #nrf52832-hal = { version = "0.10", default-features = false, features = ["xxAA-package", "rt"] } nrf52832-hal = {version = "0.8.1", default-features = false, features = ["xxAA-package", "rt"]} -shared-bus = {version = "0.1.4", features = ["cortexm"] } st7789 = { version = "0.2", features = ["graphics", "batch", "buffer"], default-features = false } cstr_core = "0.2.0" numtoa = "0.2.3" diff --git a/src/main.rs b/src/main.rs index 10d1c74..8422821 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,11 +14,15 @@ use p_hal::{delay::Delay, rng::RngExt, spim, twim}; use cortex_m_rt as rt; use cst816s::CST816S; +use cstr_core::CStr; use embedded_graphics::prelude::*; +use embedded_hal::blocking::delay::{DelayMs, DelayUs}; +use embedded_hal::digital::v2::OutputPin; +use nrf52832_hal::prelude::ClocksExt; +use numtoa::NumToA; use rt::entry; use st7789::Orientation; -use cstr_core::CStr; use lvgl::input_device::{InputData, Pointer}; use lvgl::style::Style; use lvgl::widgets::{Btn, Label}; @@ -26,16 +30,6 @@ use lvgl::{self, Align, Color, Part, State, Widget, UI}; use core::panic::PanicInfo; use core::time::Duration; -use embedded_hal::blocking::delay::{DelayMs, DelayUs}; -use embedded_hal::digital::v2::OutputPin; -use nrf52832_hal::prelude::ClocksExt; -use numtoa::NumToA; - -pub type HalSpimError = p_hal::spim::Error; - -pub type Spim0PortType = p_hal::spim::Spim; -pub type DisplaySckPinType = p_hal::gpio::p0::P0_18>; -pub type DisplayMosiPinType = p_hal::gpio::p0::P0_26>; /// /// This example was written and tested for the PineTime smart watch @@ -49,7 +43,7 @@ fn main() -> ! { // Optimize clock config let dp = pac::Peripherals::take().unwrap(); - let mut lcd_delay = delay::TimerDelay::new(dp.TIMER0); + let lcd_delay = delay::TimerDelay::new(dp.TIMER0); // Set up clocks. On reset, the high frequency clock is already used, // but we also need to switch to the external HF oscillator. This is @@ -117,7 +111,6 @@ fn main() -> ! { spim::MODE_3, 0, ); - let spi_bus0 = shared_bus::CortexMBusManager::new(spi); // Chip select must be held low while driving the display. It must be high // when using other SPI devices on the same bus (such as external flash @@ -127,7 +120,7 @@ fn main() -> ! { // Initialize LCD let mut lcd = st7789::ST7789::new( - spi_bus0.acquire(), + spi, lcd_dc, lcd_rst, lvgl::HOR_RES_MAX as u16,