panic_msp430/lib.rs
1//! Set panicking behaviour to an infinite loop.
2//!
3//! Unlike other panic implementations, this one relies on intrinsics specific to MSP430, so it
4//! actually builds on MSP430 targets. The implementation was originally extracted from msp430-rt
5//! crate.
6
7#![deny(missing_docs)]
8#![deny(warnings)]
9#![no_std]
10
11extern crate msp430;
12
13use core::panic::PanicInfo;
14
15#[panic_handler]
16fn panic(_info: &PanicInfo) -> ! {
17 // Disable interrupts to prevent further damage.
18 msp430::interrupt::disable();
19 loop {
20 // Prevent optimizations that can remove this loop.
21 msp430::asm::barrier();
22 }
23}