From e2df601d662d19fd5dab0f26ce98e7cb06b129e5 Mon Sep 17 00:00:00 2001 From: Robin Mueller Date: Mon, 8 Nov 2021 10:03:10 +0100 Subject: [PATCH] added RTT example app --- CHANGELOG.md | 3 +++ examples/rtt-log.rs | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 examples/rtt-log.rs diff --git a/CHANGELOG.md b/CHANGELOG.md index 0381e9f..eb90d23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,5 +10,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [0.1.0] +### Added + - First version of the HAL which adds the GPIO implementation and timer implementation. - Also adds some examples and helper files to set up new binary crates +- RTT example application diff --git a/examples/rtt-log.rs b/examples/rtt-log.rs new file mode 100644 index 0000000..11f55be --- /dev/null +++ b/examples/rtt-log.rs @@ -0,0 +1,19 @@ +//! Code to test RTT logger functionality +#![no_main] +#![no_std] + +use cortex_m_rt::entry; +use panic_halt as _; +use rtt_target::{rprintln, rtt_init_print}; +use va108xx as _; + +#[entry] +fn main() -> ! { + rtt_init_print!(); + let mut counter = 0; + loop { + rprintln!("{}: Hello, world!", counter); + counter += 1; + cortex_m::asm::delay(25_000_000); + } +}