Skip to content

Commit f76f433

Browse files
committed
mode after pin number
1 parent b72ab2a commit f76f433

14 files changed

+244
-254
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
77

88
## Changed
99

10+
- `gpio` updates & cleanups: mode after pin numbers (Rust 1.59), default modes
1011
- Use `fugit` duration nd rate units instead of custom
1112
- Use const-generics for GPIO (require Rust 1.51)
1213

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ _formerly [MabezDev/stm32l4xx-hal](https://github.com/mabezdev/stm32l4xx-hal)_
1414

1515
## About
1616

17-
- Minimum rustc version 1.31
17+
- Minimum rustc version 1.59
1818

1919
## License
2020

src/can.rs

+3-7
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ pub trait Pins: sealed::Sealed {
2020
macro_rules! pins {
2121
($($PER:ident => ($tx:ident<$txaf:literal>, $rx:ident<$rxaf:literal>),)+) => {
2222
$(
23-
impl crate::can::sealed::Sealed for ($tx<crate::gpio::Alternate<PushPull, $txaf, >>, $rx<crate::gpio::Alternate<PushPull, $rxaf>>) {}
24-
impl crate::can::Pins for ($tx<crate::gpio::Alternate<PushPull, $txaf, >>, $rx<crate::gpio::Alternate<PushPull, $rxaf>>) {
23+
impl crate::can::sealed::Sealed for ($tx<crate::gpio::Alternate<$txaf>>, $rx<crate::gpio::Alternate<$rxaf>>) {}
24+
impl crate::can::Pins for ($tx<crate::gpio::Alternate<$txaf>>, $rx<crate::gpio::Alternate<$rxaf>>) {
2525
type Instance = $PER;
2626
}
2727
)+
@@ -33,7 +33,6 @@ mod common_pins {
3333
gpioa::{PA11, PA12},
3434
gpiob::{PB8, PB9},
3535
gpiod::{PD0, PD1},
36-
PushPull,
3736
};
3837
use crate::pac::CAN1;
3938

@@ -48,10 +47,7 @@ mod common_pins {
4847
// L4x1
4948
#[cfg(any(feature = "stm32l431", feature = "stm32l451", feature = "stm32l471"))]
5049
mod pb13_pb12_af10 {
51-
use crate::gpio::{
52-
gpiob::{PB12, PB13},
53-
PushPull,
54-
};
50+
use crate::gpio::gpiob::{PB12, PB13};
5551
use crate::pac::CAN1;
5652
pins! { CAN1 => (PB13<10>, PB12<10>), }
5753
}

0 commit comments

Comments
 (0)