Undoing unnecessary changes

This commit is contained in:
Dion Dokter
2021-10-12 11:43:57 +02:00
parent 995cd01cbc
commit 2c2c284482
14 changed files with 90 additions and 151 deletions

View File

@ -10,18 +10,14 @@ use embedded_hal::digital::v2::{InputPin, OutputPin, StatefulOutputPin};
use gpio::pin_cnf::DRIVE_A;
use crate::pac;
#[cfg(not(feature = "nrf9160"))]
use crate::pac::p0 as gpio;
#[cfg(feature = "nrf9160")]
use crate::pac::p0_ns as gpio;
use self::sealed::Pin as _;
/// A GPIO port with up to 32 pins.
#[derive(Debug, Eq, PartialEq)]
pub enum Port {
/// Port 0, available on all nRF52 and nRF51 MCUs.
/// Port 0, available on nRF9160 and all nRF52 and nRF51 MCUs.
Port0,
/// Port 1, only available on some nRF52 MCUs.
@ -303,10 +299,7 @@ pub(crate) mod sealed {
fn block(&self) -> &gpio::RegisterBlock {
unsafe {
match self.pin_port() / 32 {
#[cfg(not(feature = "nrf9160"))]
0 => &*pac::P0::ptr(),
#[cfg(feature = "nrf9160")]
0 => &*pac::P0_NS::ptr(),
#[cfg(any(feature = "nrf52833", feature = "nrf52840"))]
1 => &*pac::P1::ptr(),
_ => unreachable_unchecked(),