From 6e7abba9ff0d1b17e0b81b1a3f87794e59e65128 Mon Sep 17 00:00:00 2001 From: Dario Nieuwenhuis Date: Mon, 11 Oct 2021 01:09:57 +0200 Subject: [PATCH] nrf: rename Cargo feature references from "51" to "nrf51". Note: the feature doesn't actually exist, references are there just in case nrf51xx is supported in the future. --- embassy-nrf/src/gpiote.rs | 8 ++++---- embassy-nrf/src/ppi.rs | 18 +++++++++--------- embassy-nrf/src/util.rs | 2 +- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/embassy-nrf/src/gpiote.rs b/embassy-nrf/src/gpiote.rs index 001ee7fb..25d09db4 100644 --- a/embassy-nrf/src/gpiote.rs +++ b/embassy-nrf/src/gpiote.rs @@ -239,14 +239,14 @@ impl<'d, C: Channel, T: GpioPin> OutputChannel<'d, C, T> { } /// Triggers `task set` (set associated pin high). - #[cfg(not(feature = "51"))] + #[cfg(not(feature = "nrf51"))] pub fn set(&self) { let g = unsafe { &*pac::GPIOTE::ptr() }; g.tasks_set[self.ch.number()].write(|w| unsafe { w.bits(1) }); } /// Triggers `task clear` (set associated pin low). - #[cfg(not(feature = "51"))] + #[cfg(not(feature = "nrf51"))] pub fn clear(&self) { let g = unsafe { &*pac::GPIOTE::ptr() }; g.tasks_clr[self.ch.number()].write(|w| unsafe { w.bits(1) }); @@ -259,14 +259,14 @@ impl<'d, C: Channel, T: GpioPin> OutputChannel<'d, C, T> { } /// Returns the CLR task, for use with PPI. - #[cfg(not(feature = "51"))] + #[cfg(not(feature = "nrf51"))] pub fn task_clr(&self) -> Task { let g = unsafe { &*pac::GPIOTE::ptr() }; Task::from_reg(&g.tasks_clr[self.ch.number()]) } /// Returns the SET task, for use with PPI. - #[cfg(not(feature = "51"))] + #[cfg(not(feature = "nrf51"))] pub fn task_set(&self) -> Task { let g = unsafe { &*pac::GPIOTE::ptr() }; Task::from_reg(&g.tasks_set[self.ch.number()]) diff --git a/embassy-nrf/src/ppi.rs b/embassy-nrf/src/ppi.rs index 61028c03..a18dec12 100644 --- a/embassy-nrf/src/ppi.rs +++ b/embassy-nrf/src/ppi.rs @@ -31,7 +31,7 @@ impl<'d, C: Channel> Ppi<'d, C> { ch, phantom: PhantomData, }; - #[cfg(not(feature = "51"))] + #[cfg(not(feature = "nrf51"))] this.clear_fork_task(); this } @@ -50,7 +50,7 @@ impl<'d, C: Channel> Ppi<'d, C> { .write(|w| unsafe { w.bits(1 << self.ch.number()) }); } - #[cfg(not(feature = "51"))] + #[cfg(not(feature = "nrf51"))] /// Sets the fork task that must be triggered when the configured event occurs. The user must /// provide a reference to the task. pub fn set_fork_task(&mut self, task: Task) { @@ -60,7 +60,7 @@ impl<'d, C: Channel> Ppi<'d, C> { .write(|w| unsafe { w.bits(task.0.as_ptr() as u32) }) } - #[cfg(not(feature = "51"))] + #[cfg(not(feature = "nrf51"))] /// Clear the fork task endpoint. Previously set task will no longer be triggered. pub fn clear_fork_task(&mut self) { let r = unsafe { &*pac::PPI::ptr() }; @@ -199,13 +199,13 @@ impl_channel!(PPI_CH12, 12, configurable); impl_channel!(PPI_CH13, 13, configurable); impl_channel!(PPI_CH14, 14, configurable); impl_channel!(PPI_CH15, 15, configurable); -#[cfg(not(feature = "51"))] +#[cfg(not(feature = "nrf51"))] impl_channel!(PPI_CH16, 16, configurable); -#[cfg(not(feature = "51"))] +#[cfg(not(feature = "nrf51"))] impl_channel!(PPI_CH17, 17, configurable); -#[cfg(not(feature = "51"))] +#[cfg(not(feature = "nrf51"))] impl_channel!(PPI_CH18, 18, configurable); -#[cfg(not(feature = "51"))] +#[cfg(not(feature = "nrf51"))] impl_channel!(PPI_CH19, 19, configurable); impl_channel!(PPI_CH20, 20); impl_channel!(PPI_CH21, 21); @@ -249,7 +249,7 @@ impl_group!(PPI_GROUP0, 0); impl_group!(PPI_GROUP1, 1); impl_group!(PPI_GROUP2, 2); impl_group!(PPI_GROUP3, 3); -#[cfg(not(feature = "51"))] +#[cfg(not(feature = "nrf51"))] impl_group!(PPI_GROUP4, 4); -#[cfg(not(feature = "51"))] +#[cfg(not(feature = "nrf51"))] impl_group!(PPI_GROUP5, 5); diff --git a/embassy-nrf/src/util.rs b/embassy-nrf/src/util.rs index 7c3974ee..344fb01f 100644 --- a/embassy-nrf/src/util.rs +++ b/embassy-nrf/src/util.rs @@ -8,7 +8,7 @@ pub(crate) fn slice_in_ram(slice: &[u8]) -> bool { } /// Return an error if slice is not in RAM. -#[cfg(not(feature = "51"))] +#[cfg(not(feature = "nrf51"))] pub(crate) fn slice_in_ram_or(slice: &[u8], err: T) -> Result<(), T> { if slice.len() == 0 || slice_in_ram(slice) { Ok(())