wip
This commit is contained in:
parent
b5bfc0081f
commit
7a4bb73a43
@ -13,7 +13,7 @@ cortex-m-semihosting = "0.3.7"
|
|||||||
|
|
||||||
panic-semihosting = "0.5.6"
|
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]
|
[dependencies.embedded-hal]
|
||||||
version = "0.2.3"
|
version = "0.2.3"
|
||||||
|
@ -1,10 +1,10 @@
|
|||||||
#![no_std]
|
#![no_std]
|
||||||
#![no_main]
|
#![no_main]
|
||||||
use cortex_m::peripheral::{syst, Peripherals};
|
use cortex_m::peripheral::Peripherals;
|
||||||
use cortex_m_rt::{entry, exception};
|
use cortex_m_rt::{entry, exception};
|
||||||
use cortex_m_semihosting::hprintln;
|
use cortex_m_semihosting::hprintln;
|
||||||
|
|
||||||
use nrf52_hal as hal;
|
use nrf52_pac;
|
||||||
|
|
||||||
use panic_semihosting as _;
|
use panic_semihosting as _;
|
||||||
|
|
||||||
@ -18,13 +18,13 @@ fn main() -> ! {
|
|||||||
|
|
||||||
let peripherals = Peripherals::take().unwrap();
|
let peripherals = Peripherals::take().unwrap();
|
||||||
let mut systick = peripherals.SYST;
|
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.set_reload(F_CPU / 1000 - 1);
|
||||||
systick.clear_current();
|
systick.clear_current();
|
||||||
systick.enable_interrupt();
|
systick.enable_interrupt();
|
||||||
systick.enable_counter();
|
systick.enable_counter();
|
||||||
|
|
||||||
let nrf_peripherals = hal::Peripherals::take().unwrap();
|
let nrf_peripherals = nrf52_pac::Peripherals::take().unwrap();
|
||||||
let p0 = nrf_peripherals.P0;
|
let p0 = nrf_peripherals.P0;
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
|
Loading…
Reference in New Issue
Block a user