Skip to content

Commit 588c8ca

Browse files
committed
Put the panic handler behind a feature flag
1 parent 0b24c51 commit 588c8ca

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

Cargo.toml

Lines changed: 3 additions & 1 deletion
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

Lines changed: 11 additions & 1 deletion
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy