diff options
Diffstat (limited to 'embassy-imxrt/src/gpio.rs')
| -rw-r--r-- | embassy-imxrt/src/gpio.rs | 20 |
1 files changed, 1 insertions, 19 deletions
diff --git a/embassy-imxrt/src/gpio.rs b/embassy-imxrt/src/gpio.rs index 6883c4ee0..e62fde8b1 100644 --- a/embassy-imxrt/src/gpio.rs +++ b/embassy-imxrt/src/gpio.rs | |||
| @@ -13,7 +13,7 @@ use crate::clocks::enable_and_reset; | |||
| 13 | use crate::iopctl::IopctlPin; | 13 | use crate::iopctl::IopctlPin; |
| 14 | pub use crate::iopctl::{AnyPin, DriveMode, DriveStrength, Function, Inverter, Pull, SlewRate}; | 14 | pub use crate::iopctl::{AnyPin, DriveMode, DriveStrength, Function, Inverter, Pull, SlewRate}; |
| 15 | use crate::sealed::Sealed; | 15 | use crate::sealed::Sealed; |
| 16 | use crate::{interrupt, peripherals, Peri, PeripheralType}; | 16 | use crate::{interrupt, peripherals, BitIter, Peri, PeripheralType}; |
| 17 | 17 | ||
| 18 | // This should be unique per IMXRT package | 18 | // This should be unique per IMXRT package |
| 19 | const PORT_COUNT: usize = 8; | 19 | const PORT_COUNT: usize = 8; |
| @@ -64,24 +64,6 @@ fn GPIO_INTA() { | |||
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | #[cfg(feature = "rt")] | 66 | #[cfg(feature = "rt")] |
| 67 | struct BitIter(u32); | ||
| 68 | |||
| 69 | #[cfg(feature = "rt")] | ||
| 70 | impl Iterator for BitIter { | ||
| 71 | type Item = u32; | ||
| 72 | |||
| 73 | fn next(&mut self) -> Option<Self::Item> { | ||
| 74 | match self.0.trailing_zeros() { | ||
| 75 | 32 => None, | ||
| 76 | b => { | ||
| 77 | self.0 &= !(1 << b); | ||
| 78 | Some(b) | ||
| 79 | } | ||
| 80 | } | ||
| 81 | } | ||
| 82 | } | ||
| 83 | |||
| 84 | #[cfg(feature = "rt")] | ||
| 85 | fn irq_handler(port_wakers: &[Option<&PortWaker>]) { | 67 | fn irq_handler(port_wakers: &[Option<&PortWaker>]) { |
| 86 | let reg = unsafe { crate::pac::Gpio::steal() }; | 68 | let reg = unsafe { crate::pac::Gpio::steal() }; |
| 87 | 69 | ||
