Files
stm32_rust/hal_adc/src/lib.rs
2025-10-20 22:37:21 +02:00

19 lines
521 B
Rust

#![no_std]
use defmt_rtt as _; // global logger
use panic_probe as _;
// same panicking *behavior* as `panic-probe` but doesn't print a panic message
// this prevents the panic message being printed *twice* when `defmt::panic` is invoked
#[defmt::panic_handler]
fn panic() -> ! {
cortex_m::asm::udf()
}
/// HardFault exit handler
#[cortex_m_rt::exception]
unsafe fn HardFault(_frame: &cortex_m_rt::ExceptionFrame) -> ! {
cortex_m::asm::bkpt(); // stay under debugger rather than exit semihosting
loop {}
}