Skip to content

Commit 2852803

Browse files
committed
HL trait instead of generic
1 parent 1c803af commit 2852803

File tree

16 files changed

+420
-429
lines changed

16 files changed

+420
-429
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
3232

3333
### Changed
3434

35+
- `gpio` updates & cleanups: mode after pin numbers (Rust 1.59), default modes
3536
- Use device-specific features rather than by-peripheral features.
3637
- Use `fugit` duration nd rate units instead of custom
3738
- Use const-generics for GPIO (require Rust 1.51)

Cargo.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ exclude = [
1818
"docs/",
1919
"docs/*"
2020
]
21-
edition = "2018"
21+
edition = "2021"
22+
rust-version = "1.59"
2223

2324
[dependencies]
24-
cortex-m = "0.7"
25+
cortex-m = "0.7.5"
2526
nb = "0.1.1"
2627
stm32l4 = "0.14.0"
2728
embedded-dma = "0.1"

README.md

Lines changed: 1 addition & 1 deletion
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.51
17+
- Minimum rustc version 1.59
1818

1919
## License
2020

src/can.rs

Lines changed: 3 additions & 7 deletions
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)