diff options
| author | Dario Nieuwenhuis <[email protected]> | 2020-12-29 01:05:28 +0100 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2020-12-29 01:05:28 +0100 |
| commit | 4b8d8ba87ee26173b0a7743c606c76df2d171790 (patch) | |
| tree | 0e8106a564d3db25c340df170592b1e0a54d8c59 /examples/src/bin/rtc_async.rs | |
| parent | 0750234fbead723138d6d1ebb0635a55c82923e0 (diff) | |
Update RTC for owned irqs
Diffstat (limited to 'examples/src/bin/rtc_async.rs')
| -rw-r--r-- | examples/src/bin/rtc_async.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/examples/src/bin/rtc_async.rs b/examples/src/bin/rtc_async.rs index aec70a072..dcdeb7049 100644 --- a/examples/src/bin/rtc_async.rs +++ b/examples/src/bin/rtc_async.rs | |||
| @@ -8,13 +8,13 @@ use example_common::*; | |||
| 8 | 8 | ||
| 9 | use core::mem::MaybeUninit; | 9 | use core::mem::MaybeUninit; |
| 10 | use cortex_m_rt::entry; | 10 | use cortex_m_rt::entry; |
| 11 | use nrf52840_hal::clocks; | 11 | use defmt::panic; |
| 12 | |||
| 13 | use embassy::executor::{task, Executor}; | 12 | use embassy::executor::{task, Executor}; |
| 14 | use embassy::time::{Clock, Duration, Timer}; | 13 | use embassy::time::{Clock, Duration, Timer}; |
| 15 | use embassy::util::Forever; | 14 | use embassy::util::Forever; |
| 16 | use embassy_nrf::pac; | 15 | use embassy_nrf::pac; |
| 17 | use embassy_nrf::rtc; | 16 | use embassy_nrf::{interrupt, rtc}; |
| 17 | use nrf52840_hal::clocks; | ||
| 18 | 18 | ||
| 19 | #[task] | 19 | #[task] |
| 20 | async fn run1() { | 20 | async fn run1() { |
| @@ -47,7 +47,7 @@ fn main() -> ! { | |||
| 47 | .set_lfclk_src_external(clocks::LfOscConfiguration::NoExternalNoBypass) | 47 | .set_lfclk_src_external(clocks::LfOscConfiguration::NoExternalNoBypass) |
| 48 | .start_lfclk(); | 48 | .start_lfclk(); |
| 49 | 49 | ||
| 50 | let rtc = RTC.put(rtc::RTC::new(p.RTC1)); | 50 | let rtc = RTC.put(rtc::RTC::new(p.RTC1, interrupt::take!(RTC1))); |
| 51 | rtc.start(); | 51 | rtc.start(); |
| 52 | 52 | ||
| 53 | unsafe { embassy::time::set_clock(rtc) }; | 53 | unsafe { embassy::time::set_clock(rtc) }; |
