From c7a9b9f3d4b9e71303c7b988d2bd916c2e4df9bc Mon Sep 17 00:00:00 2001 From: Ian McIntyre Date: Tue, 2 Aug 2022 06:21:12 -0400 Subject: First commit --- examples/blink-blocking.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 examples/blink-blocking.rs (limited to 'examples/blink-blocking.rs') diff --git a/examples/blink-blocking.rs b/examples/blink-blocking.rs new file mode 100644 index 0000000..a3a71b9 --- /dev/null +++ b/examples/blink-blocking.rs @@ -0,0 +1,18 @@ +//! Slowly blink an LED while blocking on a timer. +//! +//! Use this as the minimum-viable runtime support. You don't +//! need interrupts for this example. + +#![no_std] +#![no_main] + +const PIT_PERIOD_US: u32 = 1_000_000; + +#[imxrt_rt::entry] +fn main() -> ! { + let board::Resources { mut pit, led, .. } = board::prepare(PIT_PERIOD_US).unwrap(); + loop { + led.toggle(); + pit.blocking_delay(); + } +} -- cgit v1.2.3