From a78707b779e10e6ed9ee5228de425836c97b3373 Mon Sep 17 00:00:00 2001 From: Felipe Balbi Date: Wed, 9 Apr 2025 13:15:02 -0700 Subject: Add Embassy iMXRT RTC Time Driver --- examples/mimxrt6/Cargo.toml | 3 ++- examples/mimxrt6/src/bin/blinky.rs | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/mimxrt6/Cargo.toml b/examples/mimxrt6/Cargo.toml index 894ce174c..0e4a1ee36 100644 --- a/examples/mimxrt6/Cargo.toml +++ b/examples/mimxrt6/Cargo.toml @@ -12,7 +12,8 @@ defmt-rtt = "1.0" embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } embassy-futures = { version = "0.1.1", path = "../../embassy-futures" } -embassy-imxrt = { version = "0.1.0", path = "../../embassy-imxrt", features = ["defmt", "mimxrt685s", "unstable-pac"] } +embassy-imxrt = { version = "0.1.0", path = "../../embassy-imxrt", features = ["defmt", "mimxrt685s", "unstable-pac", "time", "time-driver-rtc"] } +embassy-time = { version = "0.4", path = "../../embassy-time" } embassy-sync = { version = "0.6.2", path = "../../embassy-sync", features = ["defmt"] } embedded-hal-1 = { package = "embedded-hal", version = "1.0" } embedded-hal-async = "1.0.0" diff --git a/examples/mimxrt6/src/bin/blinky.rs b/examples/mimxrt6/src/bin/blinky.rs index e40e71e6f..de079d505 100644 --- a/examples/mimxrt6/src/bin/blinky.rs +++ b/examples/mimxrt6/src/bin/blinky.rs @@ -6,6 +6,7 @@ extern crate embassy_imxrt_examples; use defmt::info; use embassy_executor::Spawner; use embassy_imxrt::gpio; +use embassy_time::Timer; #[embassy_executor::main] async fn main(_spawner: Spawner) { @@ -24,6 +25,6 @@ async fn main(_spawner: Spawner) { loop { info!("Toggling LED"); led.toggle(); - cortex_m::asm::delay(5_000_000); + Timer::after_secs(1).await; } } -- cgit