aboutsummaryrefslogtreecommitdiff
path: root/cortex-m-rt/examples/main.rs
blob: d319249458a6cf41b990da37ba83d49b5811014d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
//! Directly plug a `main` symbol instead of using `entry!`

#![deny(warnings)]
#![no_main]
#![no_std]

#[macro_use(exception)]
extern crate cortex_m_rt as rt;
extern crate panic_semihosting;

use rt::ExceptionFrame;

#[no_mangle]
pub unsafe extern "C" fn main() -> ! {
    loop {}
}

// the hard fault handler
exception!(HardFault, hard_fault);

fn hard_fault(_ef: &ExceptionFrame) -> ! {
    loop {}
}

// the default exception handler
exception!(*, default_handler);

fn default_handler(_irqn: i16) {}