-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
88: v0.5.2 r=therealprof a=japaric changes required for a new release this commit also simplifies the examples by removing the exception handler overrides and adds an example that overrides the exception handlers. r? @adamgreig (chosen at random) Co-authored-by: Jorge Aparicio <jorge@japaric.io> Co-authored-by: Adam Greig <adam@adamgreig.com>
- Loading branch information
Showing
9 changed files
with
87 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ main() { | |
alignment | ||
minimal | ||
main | ||
override-exception | ||
pre_init | ||
state | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
//! How to override the hard fault exception handler and the default exception handler | ||
|
||
#![deny(unsafe_code)] | ||
#![deny(warnings)] | ||
#![no_main] | ||
#![no_std] | ||
|
||
extern crate cortex_m; | ||
#[macro_use(entry, exception)] | ||
extern crate cortex_m_rt as rt; | ||
extern crate panic_semihosting; | ||
|
||
use cortex_m::asm; | ||
use rt::ExceptionFrame; | ||
|
||
// the program entry point | ||
entry!(main); | ||
|
||
fn main() -> ! { | ||
loop {} | ||
} | ||
|
||
exception!(*, default_handler); | ||
|
||
fn default_handler(_irqn: i16) { | ||
asm::bkpt(); | ||
} | ||
|
||
exception!(HardFault, hard_fault); | ||
|
||
fn hard_fault(_ef: &ExceptionFrame) -> ! { | ||
asm::bkpt(); | ||
|
||
loop {} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters