Update examples to newer svd2rust api.

Similarly, the cortex-m crate API was also updated.
This commit is contained in:
Kitlith
2018-02-24 18:26:31 -08:00
parent bf91f60d40
commit 9f573d73b2
7 changed files with 69 additions and 67 deletions

View File

@@ -20,14 +20,13 @@
extern crate cortex_m;
extern crate cortex_m_rt;
use cortex_m::{asm, interrupt, peripheral};
use cortex_m::{asm, Peripherals};
fn main() {
interrupt::free(|cs| {
let itm = peripheral::ITM.borrow(&cs);
let p = Peripherals::take().unwrap();
let mut itm = p.ITM;
iprintln!(&itm.stim[0], "Hello, world!");
});
iprintln!(&mut itm.stim[0], "Hello, world!");
}
// As we are not using interrupts, we just register a dummy catch all handler