Remove unused code

This commit is contained in:
Rafael Caricio 2020-06-21 14:02:40 +02:00
parent 4be24df654
commit 36723052d5
3 changed files with 13 additions and 50 deletions

41
Cargo.lock generated
View file

@ -19,12 +19,6 @@ dependencies = [
"memchr", "memchr",
] ]
[[package]]
name = "aligned"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d39da9b88ae1a81c03c9c082b8db83f1d0e93914126041962af61034ab44c4a5"
[[package]] [[package]]
name = "aligned" name = "aligned"
version = "0.3.2" version = "0.3.2"
@ -172,25 +166,13 @@ dependencies = [
"vec_map", "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]] [[package]]
name = "cortex-m" name = "cortex-m"
version = "0.6.2" version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2954942fbbdd49996704e6f048ce57567c3e1a4e2dc59b41ae9fde06a01fc763" checksum = "2954942fbbdd49996704e6f048ce57567c3e1a4e2dc59b41ae9fde06a01fc763"
dependencies = [ dependencies = [
"aligned 0.3.2", "aligned",
"bare-metal", "bare-metal",
"volatile-register", "volatile-register",
] ]
@ -222,7 +204,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "988624bfaeaa34565792f7badc33cd02e84ba51fff4bbc3cd76f59d4af5658e7" checksum = "988624bfaeaa34565792f7badc33cd02e84ba51fff4bbc3cd76f59d4af5658e7"
dependencies = [ dependencies = [
"cortex-m 0.6.2", "cortex-m",
"embedded-hal", "embedded-hal",
] ]
@ -448,7 +430,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "03dcdf72cd52a1c4829905e08a90ad6f4dc0f9d15ecf1883cc74f098199aa873" checksum = "03dcdf72cd52a1c4829905e08a90ad6f4dc0f9d15ecf1883cc74f098199aa873"
dependencies = [ dependencies = [
"cast", "cast",
"cortex-m 0.6.2", "cortex-m",
"embedded-hal", "embedded-hal",
"fpa", "fpa",
"nb", "nb",
@ -464,7 +446,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dd4803f1d08e6a4c8726ae68b40cecf7c2ab05f49b1ce29af932d052cb61114c" checksum = "dd4803f1d08e6a4c8726ae68b40cecf7c2ab05f49b1ce29af932d052cb61114c"
dependencies = [ dependencies = [
"cast", "cast",
"cortex-m 0.6.2", "cortex-m",
"embedded-hal", "embedded-hal",
"nb", "nb",
"nrf52-hal-common", "nrf52-hal-common",
@ -479,7 +461,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c4545414415bddd872f13c0a5418ecc380e34347a52cb048cfed38c1b0957fa" checksum = "3c4545414415bddd872f13c0a5418ecc380e34347a52cb048cfed38c1b0957fa"
dependencies = [ dependencies = [
"bare-metal", "bare-metal",
"cortex-m 0.6.2", "cortex-m",
"cortex-m-rt", "cortex-m-rt",
"vcell", "vcell",
] ]
@ -520,7 +502,7 @@ checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
name = "pinetime-rs" name = "pinetime-rs"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"cortex-m 0.6.2", "cortex-m",
"cortex-m-rt", "cortex-m-rt",
"cst816s", "cst816s",
"cstr_core", "cstr_core",
@ -529,7 +511,6 @@ dependencies = [
"lvgl", "lvgl",
"nrf52832-hal", "nrf52832-hal",
"numtoa", "numtoa",
"shared-bus",
"st7789", "st7789",
] ]
@ -617,16 +598,6 @@ version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 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]] [[package]]
name = "shlex" name = "shlex"
version = "0.1.1" version = "0.1.1"

View file

@ -12,7 +12,6 @@ embedded-graphics = "0.6"
embedded-hal = {version ="0.2.3", features = ["unproven"] } embedded-hal = {version ="0.2.3", features = ["unproven"] }
#nrf52832-hal = { version = "0.10", default-features = false, features = ["xxAA-package", "rt"] } #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"]} 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 } st7789 = { version = "0.2", features = ["graphics", "batch", "buffer"], default-features = false }
cstr_core = "0.2.0" cstr_core = "0.2.0"
numtoa = "0.2.3" numtoa = "0.2.3"

View file

@ -14,11 +14,15 @@ use p_hal::{delay::Delay, rng::RngExt, spim, twim};
use cortex_m_rt as rt; use cortex_m_rt as rt;
use cst816s::CST816S; use cst816s::CST816S;
use cstr_core::CStr;
use embedded_graphics::prelude::*; 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 rt::entry;
use st7789::Orientation; use st7789::Orientation;
use cstr_core::CStr;
use lvgl::input_device::{InputData, Pointer}; use lvgl::input_device::{InputData, Pointer};
use lvgl::style::Style; use lvgl::style::Style;
use lvgl::widgets::{Btn, Label}; use lvgl::widgets::{Btn, Label};
@ -26,16 +30,6 @@ use lvgl::{self, Align, Color, Part, State, Widget, UI};
use core::panic::PanicInfo; use core::panic::PanicInfo;
use core::time::Duration; 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<pac::SPIM0>;
pub type DisplaySckPinType = p_hal::gpio::p0::P0_18<p_hal::gpio::Output<p_hal::gpio::PushPull>>;
pub type DisplayMosiPinType = p_hal::gpio::p0::P0_26<p_hal::gpio::Output<p_hal::gpio::PushPull>>;
/// ///
/// This example was written and tested for the PineTime smart watch /// This example was written and tested for the PineTime smart watch
@ -49,7 +43,7 @@ fn main() -> ! {
// Optimize clock config // Optimize clock config
let dp = pac::Peripherals::take().unwrap(); 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, // 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 // but we also need to switch to the external HF oscillator. This is
@ -117,7 +111,6 @@ fn main() -> ! {
spim::MODE_3, spim::MODE_3,
0, 0,
); );
let spi_bus0 = shared_bus::CortexMBusManager::new(spi);
// Chip select must be held low while driving the display. It must be high // 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 // when using other SPI devices on the same bus (such as external flash
@ -127,7 +120,7 @@ fn main() -> ! {
// Initialize LCD // Initialize LCD
let mut lcd = st7789::ST7789::new( let mut lcd = st7789::ST7789::new(
spi_bus0.acquire(), spi,
lcd_dc, lcd_dc,
lcd_rst, lcd_rst,
lvgl::HOR_RES_MAX as u16, lvgl::HOR_RES_MAX as u16,