1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//! Sends Hello and then World through the first ITM stimulus port
//!
//! You'll need to run `itmdump itm.fifo` (mind the file paths) to receive the
//! message on the host. Read the [`itm`] crate documentation for details.
//!
//! [`itm`]: https://docs.rs/itm/0.1.1/itm/
//!
//! ```
//!
//! #![feature(const_fn)]
//! #![feature(used)]
//! #![no_std]
//!
//! // version = "0.2.4"
//! #[macro_use]
//! extern crate cortex_m;
//!
//! // version = "0.2.0"
//! extern crate cortex_m_rt;
//!
//! // version = "0.1.0"
//! #[macro_use]
//! extern crate cortex_m_rtfm as rtfm;
//!
//! extern crate f3;
//!
//! use f3::stm32f30x;
//! use rtfm::{C0, C16, P0};
//!
//! // RESOURCES
//! peripherals!(stm32f30x, {
//! ITM: Peripheral {
//! register_block: Itm,
//! ceiling: C0,
//! },
//! });
//!
//! // INITIALIZATION PHASE
//! fn init(ref prio: P0, ceil: &C16) {
//! let itm = ITM.access(prio, ceil);
//!
//! iprintln!(&itm.stim[0], "Hello");
//! }
//!
//! // IDLE LOOP
//! fn idle(ref prio: P0, ref ceil: C0) -> ! {
//! let itm = ITM.access(prio, ceil);
//!
//! iprintln!(&itm.stim[0], "World");
//!
//! // Sleep
//! loop {
//! rtfm::wfi();
//! }
//! }
//!
//! // TASKS
//! tasks!(stm32f30x, {});
//! ```
// Auto-generated. Do not modify.