diff options
author | 2018-08-25 19:53:13 +0200 | |
---|---|---|
committer | 2018-08-25 19:53:13 +0200 | |
commit | 4c7169fa65f0c34c5461379e10f38f32c723507b (patch) | |
tree | 40335a6b6b7000f7135a8e1328c642771c33306a /cortex-m-rt/src/lib.rs | |
parent | 2557ac432eb3645671c093e3ace8787444180537 (diff) | |
download | cortex-m-4c7169fa65f0c34c5461379e10f38f32c723507b.tar.gz cortex-m-4c7169fa65f0c34c5461379e10f38f32c723507b.tar.zst cortex-m-4c7169fa65f0c34c5461379e10f38f32c723507b.zip |
two separate default handlers
Diffstat (limited to 'cortex-m-rt/src/lib.rs')
-rw-r--r-- | cortex-m-rt/src/lib.rs | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/cortex-m-rt/src/lib.rs b/cortex-m-rt/src/lib.rs index 3c2dd89..599ae06 100644 --- a/cortex-m-rt/src/lib.rs +++ b/cortex-m-rt/src/lib.rs @@ -530,9 +530,20 @@ pub unsafe extern "C" fn Reset() -> ! { } } +#[allow(unused_variables)] #[doc(hidden)] #[no_mangle] -pub unsafe extern "C" fn EndlessLoop() -> ! { +pub unsafe extern "C" fn UserHardFault_(ef: &ExceptionFrame) -> ! { + loop { + // add some side effect to prevent this from turning into a UDF instruction + // see rust-lang/rust#28728 for details + atomic::compiler_fence(Ordering::SeqCst); + } +} + +#[doc(hidden)] +#[no_mangle] +pub unsafe extern "C" fn DefaultHandler_() -> ! { loop { // add some side effect to prevent this from turning into a UDF instruction // see rust-lang/rust#28728 for details |