Skip to content

Commit 0d68027

Browse files
authored
Merge pull request #2 from tgross35/feature-flag
Put the panic handler behind a feature flag
2 parents 0b24c51 + 588c8ca commit 0d68027

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Cargo.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,7 @@ description = "A crate to write CMSIS-DAP flash algorithms for flashing embedded
1111
[dependencies]
1212

1313
[features]
14-
default = ["erase-chip"]
14+
default = ["erase-chip", "panic-handler"]
1515
erase-chip = []
16+
panic-handler = []
17+

src/lib.rs

+11-1
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
//! Implement a [CMSIS-Pack] flash algorithm in Rust
2+
//!
3+
//! [CMSIS-Pack]: https://open-cmsis-pack.github.io/Open-CMSIS-Pack-Spec/main/html/flashAlgorithm.html
4+
//!
5+
//! # Feature flags
6+
//!
7+
//! - `panic-handler` this is enabled by default and includes a simple abort-on-panic
8+
//! panic handler. Disable this feature flag if you would prefer to use a different
9+
//! handler.
10+
111
#![no_std]
212
#![no_main]
313
#![macro_use]
414

5-
#[cfg(not(test))]
15+
#[cfg(all(not(test), feature = "panic-handler"))]
616
#[panic_handler]
717
fn panic(_info: &core::panic::PanicInfo) -> ! {
818
unsafe {

0 commit comments

Comments
 (0)