2020-06-09 09:52:27 +00:00
|
|
|
#![no_main]
|
|
|
|
#![no_std]
|
|
|
|
|
2022-01-07 11:34:53 +00:00
|
|
|
|
2021-04-12 15:09:38 +00:00
|
|
|
// this imports `beginner/apps/lib.rs` to retrieve our global logger + panicking-behavior
|
|
|
|
use firmware as _;
|
2020-06-09 09:52:27 +00:00
|
|
|
|
2022-01-07 11:34:53 +00:00
|
|
|
#[rtic::app(device = dk, peripherals = true)]
|
|
|
|
mod app {
|
|
|
|
use cortex_m::asm;
|
|
|
|
use dk::Peripherals;
|
|
|
|
|
|
|
|
#[local]
|
|
|
|
struct MyLocalResources {
|
|
|
|
}
|
|
|
|
|
|
|
|
#[shared]
|
|
|
|
struct MySharedResources {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
2020-06-09 09:52:27 +00:00
|
|
|
#[init]
|
2022-01-07 11:34:53 +00:00
|
|
|
fn init(_cx: init::Context) -> (MySharedResources, MyLocalResources, init::Monotonics) {
|
2020-06-09 09:52:27 +00:00
|
|
|
dk::init().unwrap();
|
|
|
|
|
2021-04-12 15:09:38 +00:00
|
|
|
defmt::info!("Hello");
|
2022-01-07 11:34:53 +00:00
|
|
|
(MySharedResources {}, MyLocalResources {}, init::Monotonics())
|
2020-06-09 09:52:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#[idle]
|
2022-01-07 11:34:53 +00:00
|
|
|
fn idle(_cx: idle::Context) -> ! {
|
2021-04-12 15:09:38 +00:00
|
|
|
defmt::info!("world!");
|
2020-06-09 09:52:27 +00:00
|
|
|
|
|
|
|
loop {
|
|
|
|
asm::bkpt();
|
|
|
|
}
|
|
|
|
}
|
2022-01-07 11:34:53 +00:00
|
|
|
}
|