embedded-trainings-2020/down-the-stack/apps/src/bin/hello.rs

29 lines
719 B
Rust
Raw Normal View History

2023-02-14 17:48:13 +00:00
// this program does not use the standard library to avoid heap allocations.
// only the `core` library functions are available.
#![no_std]
// this program uses a custom entry point instead of `fn main()`
#![no_main]
use cortex_m::asm;
use cortex_m_rt::entry;
// this imports `beginner/apps/lib.rs` to retrieve our global logger + panicking-behavior
use apps as _;
// the custom entry point
// vvvvv
#[entry]
fn main() -> ! {
// ˆˆˆ
// ! is the 'never' type: this function never returns
// initializes the peripherals
2023-02-21 12:20:04 +00:00
dk_bsc::init().unwrap();
2023-02-14 17:48:13 +00:00
defmt::println!("Hello, world!"); // :wave:
loop {
// breakpoint: halts the program's execution
asm::bkpt();
}
}