aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf/src/timer.rs
diff options
context:
space:
mode:
Diffstat (limited to 'embassy-nrf/src/timer.rs')
-rw-r--r--embassy-nrf/src/timer.rs11
1 files changed, 3 insertions, 8 deletions
diff --git a/embassy-nrf/src/timer.rs b/embassy-nrf/src/timer.rs
index 066609ec6..5690ff0d8 100644
--- a/embassy-nrf/src/timer.rs
+++ b/embassy-nrf/src/timer.rs
@@ -15,11 +15,6 @@ use crate::pac;
15use crate::ppi::Event; 15use crate::ppi::Event;
16use crate::ppi::Task; 16use crate::ppi::Task;
17 17
18#[cfg(not(feature = "nrf9160"))]
19pub(crate) use pac::timer0;
20#[cfg(feature = "nrf9160")]
21pub(crate) use pac::timer0_ns as timer0;
22
23pub(crate) mod sealed { 18pub(crate) mod sealed {
24 19
25 use super::*; 20 use super::*;
@@ -27,7 +22,7 @@ pub(crate) mod sealed {
27 pub trait Instance { 22 pub trait Instance {
28 /// The number of CC registers this instance has. 23 /// The number of CC registers this instance has.
29 const CCS: usize; 24 const CCS: usize;
30 fn regs() -> &'static timer0::RegisterBlock; 25 fn regs() -> &'static pac::timer0::RegisterBlock;
31 /// Storage for the waker for CC register `n`. 26 /// Storage for the waker for CC register `n`.
32 fn waker(n: usize) -> &'static AtomicWaker; 27 fn waker(n: usize) -> &'static AtomicWaker;
33 } 28 }
@@ -45,8 +40,8 @@ macro_rules! impl_timer {
45 ($type:ident, $pac_type:ident, $irq:ident, $ccs:literal) => { 40 ($type:ident, $pac_type:ident, $irq:ident, $ccs:literal) => {
46 impl crate::timer::sealed::Instance for peripherals::$type { 41 impl crate::timer::sealed::Instance for peripherals::$type {
47 const CCS: usize = $ccs; 42 const CCS: usize = $ccs;
48 fn regs() -> &'static crate::timer::timer0::RegisterBlock { 43 fn regs() -> &'static pac::timer0::RegisterBlock {
49 unsafe { &*(pac::$pac_type::ptr() as *const crate::timer::timer0::RegisterBlock) } 44 unsafe { &*(pac::$pac_type::ptr() as *const pac::timer0::RegisterBlock) }
50 } 45 }
51 fn waker(n: usize) -> &'static ::embassy::waitqueue::AtomicWaker { 46 fn waker(n: usize) -> &'static ::embassy::waitqueue::AtomicWaker {
52 use ::embassy::waitqueue::AtomicWaker; 47 use ::embassy::waitqueue::AtomicWaker;