point out parts of a embedded program in helo.rs, Cargo.toml

This commit is contained in:
Lotte Steenbrink 2021-04-19 11:21:21 +02:00
parent 41c6381311
commit 50fdc33908
2 changed files with 10 additions and 1 deletions

View file

@ -12,4 +12,5 @@ rustflags = [
]
[build]
# cross-compile to this target
target = "thumbv7em-none-eabihf" # = ARM Cortex-M4

View file

@ -1,12 +1,20 @@
#![no_main]
// 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;
use panic_log as _; // the panicking behavior
#[entry]
// ˆˆˆˆ the custom entry point
fn main() -> ! {
// ˆˆˆ
// ! is the 'never' type: this function never returns
// initializes the peripherals
dk::init().unwrap();