mirror of
https://github.com/ferrous-systems/embedded-trainings-2020.git
synced 2024-06-10 09:29:26 +00:00
point out parts of a embedded program in helo.rs, Cargo.toml
This commit is contained in:
parent
41c6381311
commit
50fdc33908
|
@ -12,4 +12,5 @@ rustflags = [
|
||||||
]
|
]
|
||||||
|
|
||||||
[build]
|
[build]
|
||||||
|
# cross-compile to this target
|
||||||
target = "thumbv7em-none-eabihf" # = ARM Cortex-M4
|
target = "thumbv7em-none-eabihf" # = ARM Cortex-M4
|
|
@ -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]
|
#![no_std]
|
||||||
|
// this program uses a custom entry point instead of `fn main()`
|
||||||
|
#![no_main]
|
||||||
|
|
||||||
use cortex_m::asm;
|
use cortex_m::asm;
|
||||||
use cortex_m_rt::entry;
|
use cortex_m_rt::entry;
|
||||||
use panic_log as _; // the panicking behavior
|
use panic_log as _; // the panicking behavior
|
||||||
|
|
||||||
|
|
||||||
#[entry]
|
#[entry]
|
||||||
|
// ˆˆˆˆ the custom entry point
|
||||||
fn main() -> ! {
|
fn main() -> ! {
|
||||||
|
// ˆˆˆ
|
||||||
|
// ! is the 'never' type: this function never returns
|
||||||
|
|
||||||
// initializes the peripherals
|
// initializes the peripherals
|
||||||
dk::init().unwrap();
|
dk::init().unwrap();
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue