wspr-beacon/src/lib.rs

31 lines
681 B
Rust
Raw Permalink Normal View History

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-16 20:35:33 +02:00
pub mod loc;
2021-04-25 19:29:14 +02:00
mod si5153;
2021-04-14 20:19:33 +02:00
pub mod time;
2021-04-25 17:33:35 +02:00
pub mod wspr;
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();
}
}