Skip to content

Commit 814059b

Browse files
authored
Merge pull request #66 from gfroerli/stm32l0x1-enable-gpiocd
gpio: Enable all GPIO for all targets
2 parents 68eeba6 + 9dfb6c5 commit 814059b

File tree

3 files changed

+6
-21
lines changed

3 files changed

+6
-21
lines changed

examples/serial_dma_async.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ fn main() -> ! {
6262
// enqueue as many buffers as available into rx_buffers
6363
unsafe {
6464
// putting the same pointer in here twice would be a big mistake
65-
rx_buffers.enqueue(Pin::new(&mut BUFFER_1)).unwrap();;
66-
rx_buffers.enqueue(Pin::new(&mut BUFFER_2)).unwrap();;
65+
rx_buffers.enqueue(Pin::new(&mut BUFFER_1)).unwrap();
66+
rx_buffers.enqueue(Pin::new(&mut BUFFER_2)).unwrap();
6767
}
6868

6969
let dma_handle = &mut dma.handle;

src/exti.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,9 @@ impl ExtiExt for EXTI {
5757
let port_bm = match port {
5858
gpio::Port::PA => 0,
5959
gpio::Port::PB => 1,
60-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
6160
gpio::Port::PC => 2,
62-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
6361
gpio::Port::PD => 3,
64-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
6562
gpio::Port::PE => 4,
66-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
6763
gpio::Port::PH => {
6864
assert!((line < 2) | (line == 9) | (line == 10));
6965
5

src/gpio.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,6 @@ pub(crate) enum AltMode {
6262
AF7 = 7,
6363
}
6464

65-
#[cfg(feature = "stm32l0x1")]
66-
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
67-
pub enum Port {
68-
PA,
69-
PB,
70-
}
71-
72-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
7365
#[derive(Copy, Clone, Debug, PartialEq, Eq)]
7466
pub enum Port {
7567
PA,
@@ -505,7 +497,6 @@ gpio!(GPIOB, gpiob, iopben, PB, [
505497
PB15: (pb15, 15, Input<Floating>),
506498
]);
507499

508-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
509500
gpio!(GPIOC, gpioc, iopcen, PC, [
510501
PC0: (pc0, 0, Input<Floating>),
511502
PC1: (pc1, 1, Input<Floating>),
@@ -525,7 +516,6 @@ gpio!(GPIOC, gpioc, iopcen, PC, [
525516
PC15: (pc15, 15, Input<Floating>),
526517
]);
527518

528-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
529519
gpio!(GPIOD, gpiod, iopden, PD, [
530520
PD0: (pd0, 0, Input<Floating>),
531521
PD1: (pd1, 1, Input<Floating>),
@@ -545,7 +535,6 @@ gpio!(GPIOD, gpiod, iopden, PD, [
545535
PD15: (pd15, 15, Input<Floating>),
546536
]);
547537

548-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
549538
gpio!(GPIOE, gpioe, iopeen, PE, [
550539
PE0: (pe0, 0, Input<Floating>),
551540
PE1: (pe1, 1, Input<Floating>),
@@ -565,9 +554,9 @@ gpio!(GPIOE, gpioe, iopeen, PE, [
565554
PE15: (pe15, 15, Input<Floating>),
566555
]);
567556

568-
#[cfg(any(feature = "stm32l0x2", feature = "stm32l0x3"))]
569557
gpio!(GPIOH, gpioh, iophen, PH, [
570-
PH0: (ph0, 0, Input<Floating>),
571-
PH1: (ph1, 1, Input<Floating>),
572-
PH2: (ph2, 2, Input<Floating>),
558+
PH0: (ph0, 0, Input<Floating>),
559+
PH1: (ph1, 1, Input<Floating>),
560+
PH9: (ph9, 9, Input<Floating>),
561+
PH10: (ph10, 10, Input<Floating>),
573562
]);

0 commit comments

Comments
 (0)