drop linker-flavor, port more examples
This commit is contained in:
@@ -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 {}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user