mirror of
https://github.com/rtic-rs/rtic.git
synced 2025-12-17 21:35:20 +01:00
* Fix nrf::timer * Bootstrap nrf52840-blinky example * More work on nrf blinky example * Fix README * Add asserts for correct timer functionality * Add correctness check to other monotonics as well * Update Changelog * Fix potential timing issues * Fix race condition in nrf::rtc * Add changelog * Add rtc blinky example * Change rtc example to RC lf clock source * Add changelog to rtic-time * Add changelog * Attempt to fix CI * Update teensy4-blinky Cargo.lock
37 lines
935 B
Rust
37 lines
935 B
Rust
#![no_main]
|
|
#![no_std]
|
|
|
|
use cortex_m_semihosting::debug;
|
|
|
|
use defmt_rtt as _; // global logger
|
|
|
|
pub use nrf52840_hal as hal; // memory layout
|
|
|
|
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()
|
|
}
|
|
|
|
/// Terminates the application and makes a semihosting-capable debug tool exit
|
|
/// with status code 0.
|
|
pub fn exit() -> ! {
|
|
loop {
|
|
debug::exit(debug::EXIT_SUCCESS);
|
|
}
|
|
}
|
|
|
|
/// Hardfault handler.
|
|
///
|
|
/// Terminates the application and makes a semihosting-capable debug tool exit
|
|
/// with an error. This seems better than the default, which is to spin in a
|
|
/// loop.
|
|
#[cortex_m_rt::exception]
|
|
unsafe fn HardFault(_frame: &cortex_m_rt::ExceptionFrame) -> ! {
|
|
loop {
|
|
debug::exit(debug::EXIT_FAILURE);
|
|
}
|
|
}
|