diff options
author | 2020-08-23 22:16:07 +0000 | |
---|---|---|
committer | 2020-08-23 22:16:07 +0000 | |
commit | f4a85dcc92e90e27588cbe14e0447b89f672e30f (patch) | |
tree | 4af03e376f2c48f35109f3da21c5e96354975b4d /cortex-m-rt/examples/override-exception.rs | |
parent | cbb3c4e63079a2a70b09f8038606b1c51f34675d (diff) | |
parent | bb868f4a90c6eff142801bc1a19b135483eed312 (diff) | |
download | cortex-m-f4a85dcc92e90e27588cbe14e0447b89f672e30f.tar.gz cortex-m-f4a85dcc92e90e27588cbe14e0447b89f672e30f.tar.zst cortex-m-f4a85dcc92e90e27588cbe14e0447b89f672e30f.zip |
Merge #289
289: Make it unsafe to define NMI handlers r=therealprof a=jonas-schievink
Reverts https://github.com/rust-embedded/cortex-m-rt/pull/257
Fixes https://github.com/rust-embedded/cortex-m-rt/issues/269
Fixes https://github.com/rust-embedded/cortex-m/issues/196 (see that thread for details)
Co-authored-by: Jonas Schievink <jonasschievink@gmail.com>
Diffstat (limited to 'cortex-m-rt/examples/override-exception.rs')
-rw-r--r-- | cortex-m-rt/examples/override-exception.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cortex-m-rt/examples/override-exception.rs b/cortex-m-rt/examples/override-exception.rs index 6da6c5e..3190b77 100644 --- a/cortex-m-rt/examples/override-exception.rs +++ b/cortex-m-rt/examples/override-exception.rs @@ -1,6 +1,5 @@ //! How to override the hard fault exception handler and the default exception handler -#![deny(unsafe_code)] #![deny(warnings)] #![no_main] #![no_std] @@ -18,12 +17,12 @@ fn main() -> ! { } #[exception] -fn DefaultHandler(_irqn: i16) { +unsafe fn DefaultHandler(_irqn: i16) { asm::bkpt(); } #[exception] -fn HardFault(_ef: &ExceptionFrame) -> ! { +unsafe fn HardFault(_ef: &ExceptionFrame) -> ! { asm::bkpt(); loop {} |