From 02562ed87d4c5cd8fb3f5f41643607ea422a47ac Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Wed, 24 Aug 2022 01:52:15 +0200 Subject: [PATCH] nrf/ppi: feature-gate dppi stuff. --- embassy-nrf/src/ppi/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/embassy-nrf/src/ppi/mod.rs b/embassy-nrf/src/ppi/mod.rs index 1fdd35717..e3ac45d79 100644 --- a/embassy-nrf/src/ppi/mod.rs +++ b/embassy-nrf/src/ppi/mod.rs @@ -35,6 +35,7 @@ pub struct Ppi<'d, C: Channel, const EVENT_COUNT: usize, const TASK_COUNT: usize tasks: [Task; TASK_COUNT], } +#[cfg(feature = "_dppi")] const REGISTER_DPPI_CONFIG_OFFSET: usize = 0x80 / core::mem::size_of::(); /// Represents a task that a peripheral can do. @@ -49,7 +50,8 @@ impl Task { Self(unsafe { NonNull::new_unchecked(reg as *const _ as *mut _) }) } - /// Address off subscription register for this task. + /// Address of subscription register for this task. + #[cfg(feature = "_dppi")] pub fn subscribe_reg(&self) -> *mut u32 { unsafe { self.0.as_ptr().add(REGISTER_DPPI_CONFIG_OFFSET) } } @@ -72,6 +74,7 @@ impl Event { } /// Address of publish register for this event. + #[cfg(feature = "_dppi")] pub fn publish_reg(&self) -> *mut u32 { unsafe { self.0.as_ptr().add(REGISTER_DPPI_CONFIG_OFFSET) } }