diff options
author | 2017-03-12 11:46:33 -0500 | |
---|---|---|
committer | 2017-03-12 11:47:15 -0500 | |
commit | 83945819af5a724ba9175fdc5e22b7c854a0fc14 (patch) | |
tree | 468db2846c873d880a870162a2c46abd1e340b47 | |
parent | 8fd028a8d68975d801ce01bfde5f76733c5be7a0 (diff) | |
download | cortex-m-83945819af5a724ba9175fdc5e22b7c854a0fc14.tar.gz cortex-m-83945819af5a724ba9175fdc5e22b7c854a0fc14.tar.zst cortex-m-83945819af5a724ba9175fdc5e22b7c854a0fc14.zip |
default exception handler: identify the exception that's being serviced
-rw-r--r-- | CHANGELOG.md | 5 | ||||
-rw-r--r-- | src/exception.rs | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index ab28447..8f95aba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +### Changed + +- The default exception handler now identifies the exception that's being + serviced. + ## [v0.2.0] - 2017-03-11 ### Added diff --git a/src/exception.rs b/src/exception.rs index f5c8c28..f5b52f6 100644 --- a/src/exception.rs +++ b/src/exception.rs @@ -156,10 +156,13 @@ pub extern "C" fn default_handler<T>(_token: T) where T: Context, { - // This is the actual exception handler. `_sf` is a pointer to the previous + // This is the actual exception handler. `_sr` is a pointer to the previous // stack frame #[cfg(target_arch = "arm")] extern "C" fn handler(_sr: &StackedRegisters) -> ! { + // What exception is currently being serviced + let _e = Exception::current(); + ::asm::bkpt(); loop {} |