diff options
author | f_punk <fabiopungg@gmail.com> | 2021-09-01 16:16:56 +0200 |
---|---|---|
committer | f_punk <fabiopungg@gmail.com> | 2021-09-01 16:16:56 +0200 |
commit | a0c40562eab224d273a972fdcf5029c585974bc7 (patch) | |
tree | 69d3dc9539d0481252acc1e32d6d850ed638c310 /embassy-nrf/src/buffered_uarte.rs | |
parent | ea688afe9b32cfdf10e91805d8c1e5668e0e85cd (diff) | |
download | embassy-a0c40562eab224d273a972fdcf5029c585974bc7.zip |
added typestate to nrf-Timer
useful for hooking up the PPI to an Event without needing interrupt
tested with buffered_uart example on nRF52840-DK
Diffstat (limited to 'embassy-nrf/src/buffered_uarte.rs')
-rw-r--r-- | embassy-nrf/src/buffered_uarte.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 048c36d3..5c9f4270 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs @@ -15,9 +15,8 @@ use crate::gpio::sealed::Pin as _; use crate::gpio::{OptionalPin as GpioOptionalPin, Pin as GpioPin}; use crate::pac; use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; -use crate::timer::Frequency; use crate::timer::Instance as TimerInstance; -use crate::timer::Timer; +use crate::timer::{Frequency, NotAwaitableTimer}; use crate::uarte::{Config, Instance as UarteInstance}; // Re-export SVD variants to allow user to directly set values @@ -44,7 +43,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> State<'d, U, T> { struct StateInner<'d, U: UarteInstance, T: TimerInstance> { phantom: PhantomData<&'d mut U>, - timer: Timer<'d, T>, + timer: NotAwaitableTimer<'d, T>, _ppi_ch1: Ppi<'d, AnyConfigurableChannel>, _ppi_ch2: Ppi<'d, AnyConfigurableChannel>, @@ -85,7 +84,7 @@ impl<'d, U: UarteInstance, T: TimerInstance> BufferedUarte<'d, U, T> { let r = U::regs(); - let mut timer = Timer::new_irqless(timer); + let mut timer = NotAwaitableTimer::new(timer); rxd.conf().write(|w| w.input().connect().drive().h0h1()); r.psel.rxd.write(|w| unsafe { w.bits(rxd.psel_bits()) }); |