diff options
Diffstat (limited to 'cortex-m-rt/examples/minimal.rs')
-rw-r--r-- | cortex-m-rt/examples/minimal.rs | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cortex-m-rt/examples/minimal.rs b/cortex-m-rt/examples/minimal.rs new file mode 100644 index 0000000..c12d12d --- /dev/null +++ b/cortex-m-rt/examples/minimal.rs @@ -0,0 +1,31 @@ +//! Minimal `cortex-m-rt` based program + +#![deny(unsafe_code)] +#![deny(warnings)] +#![no_main] +#![no_std] + +#[macro_use(entry, exception)] +extern crate cortex_m_rt as rt; +extern crate panic_semihosting; + +use rt::ExceptionFrame; + +// the program entry point +entry!(main); + +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) {} |