diff options
| author | Felipe Balbi <[email protected]> | 2025-04-09 13:15:02 -0700 |
|---|---|---|
| committer | Felipe Balbi <[email protected]> | 2025-04-09 13:22:26 -0700 |
| commit | a78707b779e10e6ed9ee5228de425836c97b3373 (patch) | |
| tree | 6e9862be45f53093ee17b46b592a04ed0ff65238 /examples | |
| parent | 6919732666bdcb4b2a4d26be348c87e4ca70280b (diff) | |
Add Embassy iMXRT RTC Time Driver
Diffstat (limited to 'examples')
| -rw-r--r-- | examples/mimxrt6/Cargo.toml | 3 | ||||
| -rw-r--r-- | examples/mimxrt6/src/bin/blinky.rs | 3 |
2 files changed, 4 insertions, 2 deletions
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" | |||
| 12 | 12 | ||
| 13 | embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } | 13 | embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } |
| 14 | embassy-futures = { version = "0.1.1", path = "../../embassy-futures" } | 14 | embassy-futures = { version = "0.1.1", path = "../../embassy-futures" } |
| 15 | embassy-imxrt = { version = "0.1.0", path = "../../embassy-imxrt", features = ["defmt", "mimxrt685s", "unstable-pac"] } | 15 | embassy-imxrt = { version = "0.1.0", path = "../../embassy-imxrt", features = ["defmt", "mimxrt685s", "unstable-pac", "time", "time-driver-rtc"] } |
| 16 | embassy-time = { version = "0.4", path = "../../embassy-time" } | ||
| 16 | embassy-sync = { version = "0.6.2", path = "../../embassy-sync", features = ["defmt"] } | 17 | embassy-sync = { version = "0.6.2", path = "../../embassy-sync", features = ["defmt"] } |
| 17 | embedded-hal-1 = { package = "embedded-hal", version = "1.0" } | 18 | embedded-hal-1 = { package = "embedded-hal", version = "1.0" } |
| 18 | embedded-hal-async = "1.0.0" | 19 | 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; | |||
| 6 | use defmt::info; | 6 | use defmt::info; |
| 7 | use embassy_executor::Spawner; | 7 | use embassy_executor::Spawner; |
| 8 | use embassy_imxrt::gpio; | 8 | use embassy_imxrt::gpio; |
| 9 | use embassy_time::Timer; | ||
| 9 | 10 | ||
| 10 | #[embassy_executor::main] | 11 | #[embassy_executor::main] |
| 11 | async fn main(_spawner: Spawner) { | 12 | async fn main(_spawner: Spawner) { |
| @@ -24,6 +25,6 @@ async fn main(_spawner: Spawner) { | |||
| 24 | loop { | 25 | loop { |
| 25 | info!("Toggling LED"); | 26 | info!("Toggling LED"); |
| 26 | led.toggle(); | 27 | led.toggle(); |
| 27 | cortex_m::asm::delay(5_000_000); | 28 | Timer::after_secs(1).await; |
| 28 | } | 29 | } |
| 29 | } | 30 | } |
