This commit is contained in:
Thomas Klaehn 2021-07-31 13:31:13 +02:00
parent b5bfc0081f
commit 7a4bb73a43
2 changed files with 5 additions and 5 deletions

View File

@ -13,7 +13,7 @@ cortex-m-semihosting = "0.3.7"
panic-semihosting = "0.5.6"
nrf52-hal = { git = "https://git.blackfinn.de/rust/nrf52-hal.git" }
nrf52-pac = { git = "https://git.blackfinn.de/rust/nrf52-pac.git" }
[dependencies.embedded-hal]
version = "0.2.3"

View File

@ -1,10 +1,10 @@
#![no_std]
#![no_main]
use cortex_m::peripheral::{syst, Peripherals};
use cortex_m::peripheral::Peripherals;
use cortex_m_rt::{entry, exception};
use cortex_m_semihosting::hprintln;
use nrf52_hal as hal;
use nrf52_pac;
use panic_semihosting as _;
@ -18,13 +18,13 @@ fn main() -> ! {
let peripherals = Peripherals::take().unwrap();
let mut systick = peripherals.SYST;
systick.set_clock_source(syst::SystClkSource::Core);
systick.set_clock_source(cortex_m::peripheral::syst::SystClkSource::Core);
systick.set_reload(F_CPU / 1000 - 1);
systick.clear_current();
systick.enable_interrupt();
systick.enable_counter();
let nrf_peripherals = hal::Peripherals::take().unwrap();
let nrf_peripherals = nrf52_pac::Peripherals::take().unwrap();
let p0 = nrf_peripherals.P0;
unsafe {