aboutsummaryrefslogtreecommitdiff
path: root/embassy-nrf
diff options
context:
space:
mode:
authorDion Dokter <[email protected]>2021-10-11 15:31:25 +0200
committerDion Dokter <[email protected]>2021-10-11 15:31:25 +0200
commit995cd01cbcb2470b9ecdd953daae0cfb3aaa2e99 (patch)
treead3a55b6b9adde5609d4c07d5717ba0fcca6239c /embassy-nrf
parent4643727fea491e91f5afe9532775d0e422f744f6 (diff)
ran fmt
Diffstat (limited to 'embassy-nrf')
-rw-r--r--embassy-nrf/src/buffered_uarte.rs2
-rw-r--r--embassy-nrf/src/lib.rs4
-rw-r--r--embassy-nrf/src/ppi.rs4
-rw-r--r--embassy-nrf/src/pwm.rs1
-rw-r--r--embassy-nrf/src/time_driver.rs8
-rw-r--r--embassy-nrf/src/twim.rs2
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};
17use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task}; 17use crate::ppi::{AnyConfigurableChannel, ConfigurableChannel, Event, Ppi, Task};
18use crate::timer::Instance as TimerInstance; 18use crate::timer::Instance as TimerInstance;
19use crate::timer::{Frequency, Timer}; 19use crate::timer::{Frequency, Timer};
20use crate::uarte::{Config, Instance as UarteInstance, uarte0}; 20use 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
23pub use uarte0::{baudrate::BAUDRATE_A as Baudrate, config::PARITY_A as Parity}; 23pub 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
80pub use chip::{peripherals, Peripherals}; 80pub use chip::{peripherals, Peripherals};
81 81
82#[cfg(feature = "nrf9160")]
83use crate::pac::CLOCK_NS as CLOCK;
84#[cfg(not(feature = "nrf9160"))] 82#[cfg(not(feature = "nrf9160"))]
85use crate::pac::CLOCK; 83use crate::pac::CLOCK;
84#[cfg(feature = "nrf9160")]
85use crate::pac::CLOCK_NS as CLOCK;
86 86
87pub mod interrupt { 87pub 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
19use crate::{pac, peripherals}; 19use crate::{pac, peripherals};
20 20
21#[cfg(not(feature = "nrf9160"))]
22pub(crate) use pac::PPI;
23#[cfg(feature = "nrf9160")] 21#[cfg(feature = "nrf9160")]
24pub(crate) use pac::DPPIC_NS as PPI; 22pub(crate) use pac::DPPIC_NS as PPI;
23#[cfg(not(feature = "nrf9160"))]
24pub(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")]
17pub(crate) use pac::pwm0_ns as pwm0; 17pub(crate) use pac::pwm0_ns as pwm0;
18 18
19
20#[derive(Debug, Eq, PartialEq, Clone, Copy)] 19#[derive(Debug, Eq, PartialEq, Clone, Copy)]
21pub enum Prescaler { 20pub 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
17fn rtc() -> &'static rtc0::RegisterBlock { 17fn 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