drop linker-flavor, port more examples

This commit is contained in:
Jorge Aparicio
2018-04-26 05:25:27 +02:00
parent 0e2ec97ce6
commit 8e79d05cc4
12 changed files with 246 additions and 154 deletions

View File

@@ -2,17 +2,19 @@
//!
//! ---
#![feature(asm)]
#![no_main]
#![no_std]
extern crate cortex_m;
#[macro_use]
extern crate cortex_m_rt;
extern crate cortex_m_rt as rt;
extern crate cortex_m_semihosting as sh;
extern crate panic_abort; // panicking behavior
use core::fmt::Write;
use cortex_m::asm;
use rt::ExceptionFrame;
use sh::hio;
main!(main);
@@ -26,7 +28,17 @@ fn main() -> ! {
exception!(DefaultHandler, dh);
fn dh(_nr: u8) -> ! {
#[inline(always)]
fn dh(_nr: u8) {
asm::bkpt();
}
exception!(HardFault, hf);
#[inline(always)]
fn hf(_ef: &ExceptionFrame) -> ! {
asm::bkpt();
loop {}
}