2021-04-11 15:55:46 +02:00
|
|
|
#![no_std]
|
|
|
|
use defmt_rtt as _; // global logger
|
|
|
|
|
|
|
|
use panic_probe as _;
|
|
|
|
use stm32f1xx_hal as _;
|
|
|
|
|
2021-04-11 17:23:17 +02:00
|
|
|
pub mod application;
|
2021-04-14 20:19:33 +02:00
|
|
|
pub mod time;
|
2021-04-11 17:23:17 +02:00
|
|
|
|
2021-04-11 15:55:46 +02:00
|
|
|
// 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()
|
|
|
|
}
|
|
|
|
|
2021-04-14 20:19:33 +02:00
|
|
|
defmt::timestamp!("{=u32}", {
|
2021-04-11 15:55:46 +02:00
|
|
|
// NOTE(no-CAS) `timestamps` runs with interrupts disabled
|
2021-04-14 20:19:33 +02:00
|
|
|
time::get_timestamp()
|
2021-04-11 15:55:46 +02:00
|
|
|
});
|
|
|
|
|
|
|
|
/// Terminates the application and makes `probe-run` exit with exit-code = 0
|
|
|
|
pub fn exit() -> ! {
|
|
|
|
loop {
|
|
|
|
cortex_m::asm::bkpt();
|
|
|
|
}
|
|
|
|
}
|