Skip to content

Commit 89a097b

Browse files
committed
Reexport Direction from older embedded_hal
`embedded_hal::Direction` has been removed from recent `embedded_hal` releases. It needs to be reexported from `qei` in order to allow users of `Qei::direction()` to be able to match against the method result if they use a recent `embdded_hal` release.
1 parent 2c10000 commit 89a097b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111
- Add tools/check.py python script for local check
1212
- Add changelog check on PRs
1313
- Replace UB code by a legitimate pointer access
14+
- Reexport `Direction` from `qei`
1415

1516
## [v0.10.0] - 2022-12-12
1617

src/qei.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@ use core::u16;
88

99
use core::marker::PhantomData;
1010

11-
use crate::hal::{self, Direction};
11+
use crate::hal;
12+
pub use crate::hal::Direction;
1213
#[cfg(any(feature = "stm32f100", feature = "stm32f103", feature = "connectivity",))]
1314
use crate::pac::TIM1;
1415
#[cfg(feature = "medium")]
@@ -188,9 +189,9 @@ macro_rules! hal {
188189

189190
fn direction(&self) -> Direction {
190191
if self.tim.cr1.read().dir().bit_is_clear() {
191-
hal::Direction::Upcounting
192+
Direction::Upcounting
192193
} else {
193-
hal::Direction::Downcounting
194+
Direction::Downcounting
194195
}
195196
}
196197
}

0 commit comments

Comments
 (0)