diff options
| author | Ian McIntyre <ianpmcintyre@gmail.com> | 2022-08-02 06:21:12 -0400 |
|---|---|---|
| committer | Ian McIntyre <ianpmcintyre@gmail.com> | 2022-12-01 20:21:05 -0500 |
| commit | c7a9b9f3d4b9e71303c7b988d2bd916c2e4df9bc (patch) | |
| tree | 6d41ea7e433cac328fa165d45d1bc0cd71a1bf8f /examples/blink-blocking.rs | |
First commit
Diffstat (limited to 'examples/blink-blocking.rs')
| -rw-r--r-- | examples/blink-blocking.rs | 18 |
1 files changed, 18 insertions, 0 deletions
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(); + } +} |
