embedded-trainings-2020/advanced/firmware/src/bin/rtic-hello.rs
Mirabellensaft 02e9012e8e rustfmt
2022-01-12 21:54:59 +01:00

38 lines
747 B
Rust

#![no_main]
#![no_std]
// this imports `beginner/apps/lib.rs` to retrieve our global logger + panicking-behavior
use firmware as _;
#[rtic::app(device = dk, peripherals = false)]
mod app {
use cortex_m::asm;
#[local]
struct MyLocalResources {}
#[shared]
struct MySharedResources {}
#[init]
fn init(_cx: init::Context) -> (MySharedResources, MyLocalResources, init::Monotonics) {
dk::init().unwrap();
defmt::println!("Hello");
(
MySharedResources {},
MyLocalResources {},
init::Monotonics(),
)
}
#[idle]
fn idle(_cx: idle::Context) -> ! {
defmt::println!("world!");
loop {
asm::bkpt();
}
}
}