diff options
| author | Dion Dokter <[email protected]> | 2021-10-11 15:31:25 +0200 |
|---|---|---|
| committer | Dion Dokter <[email protected]> | 2021-10-11 15:31:25 +0200 |
| commit | 995cd01cbcb2470b9ecdd953daae0cfb3aaa2e99 (patch) | |
| tree | ad3a55b6b9adde5609d4c07d5717ba0fcca6239c /embassy-nrf | |
| parent | 4643727fea491e91f5afe9532775d0e422f744f6 (diff) | |
ran fmt
Diffstat (limited to 'embassy-nrf')
| -rw-r--r-- | embassy-nrf/src/buffered_uarte.rs | 2 | ||||
| -rw-r--r-- | embassy-nrf/src/lib.rs | 4 | ||||
| -rw-r--r-- | embassy-nrf/src/ppi.rs | 4 | ||||
| -rw-r--r-- | embassy-nrf/src/pwm.rs | 1 | ||||
| -rw-r--r-- | embassy-nrf/src/time_driver.rs | 8 | ||||
| -rw-r--r-- | embassy-nrf/src/twim.rs | 2 |
6 files changed, 12 insertions, 9 deletions
diff --git a/embassy-nrf/src/buffered_uarte.rs b/embassy-nrf/src/buffered_uarte.rs index 31acb80d6..e999cb721 100644 --- a/embassy-nrf/src/buffered_uarte.rs +++ b/embassy-nrf/src/buffered_uarte.rs | |||
| @@ -17,7 +17,7 @@ use crate::gpio::{OptionalPin as GpioOptionalPin, Pin as GpioPin}; | |||
| 17 | use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; | 17 | use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; |
| 18 | use crate::timer::Instance as TimerInstance; | 18 | use crate::timer::Instance as TimerInstance; |
| 19 | use crate::timer::{Frequency, Timer}; | 19 | use crate::timer::{Frequency, Timer}; |
| 20 | use crate::uarte::{Config, Instance as UarteInstance, uarte0}; | 20 | use crate::uarte::{uarte0, Config, Instance as UarteInstance}; |
| 21 | 21 | ||
| 22 | // Re-export SVD variants to allow user to directly set values | 22 | // Re-export SVD variants to allow user to directly set values |
| 23 | pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; | 23 | pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; |
diff --git a/embassy-nrf/src/lib.rs b/embassy-nrf/src/lib.rs index 5924a42bb..2ee04708d 100644 --- a/embassy-nrf/src/lib.rs +++ b/embassy-nrf/src/lib.rs | |||
| @@ -79,10 +79,10 @@ pub(crate) use chip::pac; | |||
| 79 | 79 | ||
| 80 | pub use chip::{peripherals, Peripherals}; | 80 | pub use chip::{peripherals, Peripherals}; |
| 81 | 81 | ||
| 82 | #[cfg(feature = "nrf9160")] | ||
| 83 | use crate::pac::CLOCK_NS as CLOCK; | ||
| 84 | #[cfg(not(feature = "nrf9160"))] | 82 | #[cfg(not(feature = "nrf9160"))] |
| 85 | use crate::pac::CLOCK; | 83 | use crate::pac::CLOCK; |
| 84 | #[cfg(feature = "nrf9160")] | ||
| 85 | use crate::pac::CLOCK_NS as CLOCK; | ||
| 86 | 86 | ||
| 87 | pub mod interrupt { | 87 | pub mod interrupt { |
| 88 | pub use crate::chip::irqs::*; | 88 | pub use crate::chip::irqs::*; |
diff --git a/embassy-nrf/src/ppi.rs b/embassy-nrf/src/ppi.rs index 727f6913c..db5387b8e 100644 --- a/embassy-nrf/src/ppi.rs +++ b/embassy-nrf/src/ppi.rs | |||
| @@ -18,10 +18,10 @@ use embassy_hal_common::{unborrow, unsafe_impl_unborrow}; | |||
| 18 | 18 | ||
| 19 | use crate::{pac, peripherals}; | 19 | use crate::{pac, peripherals}; |
| 20 | 20 | ||
| 21 | #[cfg(not(feature = "nrf9160"))] | ||
| 22 | pub(crate) use pac::PPI; | ||
| 23 | #[cfg(feature = "nrf9160")] | 21 | #[cfg(feature = "nrf9160")] |
| 24 | pub(crate) use pac::DPPIC_NS as PPI; | 22 | pub(crate) use pac::DPPIC_NS as PPI; |
| 23 | #[cfg(not(feature = "nrf9160"))] | ||
| 24 | pub(crate) use pac::PPI; | ||
| 25 | 25 | ||
| 26 | // ====================== | 26 | // ====================== |
| 27 | // driver | 27 | // driver |
diff --git a/embassy-nrf/src/pwm.rs b/embassy-nrf/src/pwm.rs index 057a13594..1bafb1d48 100644 --- a/embassy-nrf/src/pwm.rs +++ b/embassy-nrf/src/pwm.rs | |||
| @@ -16,7 +16,6 @@ pub(crate) use pac::pwm0; | |||
| 16 | #[cfg(feature = "nrf9160")] | 16 | #[cfg(feature = "nrf9160")] |
| 17 | pub(crate) use pac::pwm0_ns as pwm0; | 17 | pub(crate) use pac::pwm0_ns as pwm0; |
| 18 | 18 | ||
| 19 | |||
| 20 | #[derive(Debug, Eq, PartialEq, Clone, Copy)] | 19 | #[derive(Debug, Eq, PartialEq, Clone, Copy)] |
| 21 | pub enum Prescaler { | 20 | pub enum Prescaler { |
| 22 | Div1, | 21 | Div1, |
diff --git a/embassy-nrf/src/time_driver.rs b/embassy-nrf/src/time_driver.rs index 366f270c0..4c2438a00 100644 --- a/embassy-nrf/src/time_driver.rs +++ b/embassy-nrf/src/time_driver.rs | |||
| @@ -16,9 +16,13 @@ pub(crate) use pac::rtc0_ns as rtc0; | |||
| 16 | 16 | ||
| 17 | fn rtc() -> &'static rtc0::RegisterBlock { | 17 | fn rtc() -> &'static rtc0::RegisterBlock { |
| 18 | #[cfg(not(feature = "nrf9160"))] | 18 | #[cfg(not(feature = "nrf9160"))] |
| 19 | unsafe { &*pac::RTC1::ptr() } | 19 | unsafe { |
| 20 | &*pac::RTC1::ptr() | ||
| 21 | } | ||
| 20 | #[cfg(feature = "nrf9160")] | 22 | #[cfg(feature = "nrf9160")] |
| 21 | unsafe { &*pac::RTC1_NS::ptr() } | 23 | unsafe { |
| 24 | &*pac::RTC1_NS::ptr() | ||
| 25 | } | ||
| 22 | } | 26 | } |
| 23 | 27 | ||
| 24 | // RTC timekeeping works with something we call "periods", which are time intervals | 28 | // RTC timekeeping works with something we call "periods", which are time intervals |
diff --git a/embassy-nrf/src/twim.rs b/embassy-nrf/src/twim.rs index 2d51480d8..8dcfb4143 100644 --- a/embassy-nrf/src/twim.rs +++ b/embassy-nrf/src/twim.rs | |||
| @@ -184,7 +184,7 @@ impl<'d, T: Instance> Twim<'d, T> { | |||
| 184 | // The PTR field is a full 32 bits wide and accepts the full range | 184 | // The PTR field is a full 32 bits wide and accepts the full range |
| 185 | // of values. | 185 | // of values. |
| 186 | w.ptr().bits(buffer.as_mut_ptr() as u32)); | 186 | w.ptr().bits(buffer.as_mut_ptr() as u32)); |
| 187 | r.rxd.maxcnt.write(|w| | 187 | r.rxd.maxcnt.write(|w| |
| 188 | // We're giving it the length of the buffer, so no danger of | 188 | // We're giving it the length of the buffer, so no danger of |
| 189 | // accessing invalid memory. We have verified that the length of the | 189 | // accessing invalid memory. We have verified that the length of the |
| 190 | // buffer fits in an `u8`, so the cast to the type of maxcnt | 190 | // buffer fits in an `u8`, so the cast to the type of maxcnt |
