Skip to content

Commit 2011c21

Browse files
committed
migrate to embedded-hal=1.0.0.rc1
as alpha.10 of embedded-hal has added `SetDutyCycle` as the equivalent / successor of the old `PwmPin` support for it can now be added here. since e-h 1.0.0 will be released at the end of this year it's safe to just directly migrate to the RC1 instead of adding it as an optional support (requiring another breaking change in a later step which would then remove e-h 0.2 support).
1 parent a152edb commit 2011c21

File tree

6 files changed

+100
-88
lines changed

6 files changed

+100
-88
lines changed

CHANGELOG.md

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
88
## [Unreleased] - ReleaseDate
99
### Changed
1010
* Due to dependency updates the MSRV has been updated from 1.60 to 1.63. This should only be relevant if you use the `defmt` feature, but we now only test with 1.63 and not older releases, so it's not guaranteed to work otherwise.
11+
* Breaking: the API was migrated from `embedded-hal:0.2` to `embedded-hal:1.0.0-rc1`.
12+
If your HAL does not yet implement this, then please use the previous release of the library.
1113

1214
<!-- next-url -->
1315
[Unreleased]: https://github.com/rursprung/tb6612fng-rs/compare/v0.1.1...HEAD

Cargo.toml

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ keywords = ["tb6612fng", "driver", "motor", "controller", "embedded-hal-driver"]
1111
license = "MIT OR Apache-2.0"
1212

1313
[dependencies]
14-
embedded-hal = "0.2"
14+
embedded-hal = "1.0.0-rc.1"
1515

1616
defmt = { version = "0.3", optional = true }
1717

1818
[dev-dependencies]
19-
embedded-hal-mock = "0.10.0-rc.2"
19+
embedded-hal-mock = { version = "0.10.0-rc.2", features = ["eh1"] }

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ A simple example for the STM32F4 microcontrollers is [available](examples/stm32f
3030
For the changelog please see the dedicated [CHANGELOG.md](CHANGELOG.md).
3131

3232
## Roadmap to v1.0.0
33-
This crate is already stable, however it's based on a 0.x version of [`embedded-hal`](https://github.com/rust-embedded/embedded-hal/), making the API unstable (the change from 0.x to 1.x of e-h will be breaking).
33+
This crate is already stable, however it's based on athe v1.0.0 release candidate version of [`embedded-hal`](https://github.com/rust-embedded/embedded-hal/),
34+
making the API unstable (the change from 1.0.0-rc.1 to 1.0.0 of e-h will be breaking from a dependency management point of view).
3435
See [the tracking issue](https://github.com/rursprung/tb6612fng-rs/issues/4) for the roadmap to v1.0.0.
3536

3637
## Minimum Supported Rust Version (MSRV)

examples/stm32f4-single-motor-example/Cargo.lock

+54-37
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/stm32f4-single-motor-example/src/main.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@ mod app {
4646
// set up the motor
4747
let motor_in1 = gpiob.pb5.into_push_pull_output();
4848
let motor_in2 = gpiob.pb4.into_push_pull_output();
49-
let motor_pwm = ctx
49+
let mut motor_pwm = ctx
5050
.device
5151
.TIM2
5252
.pwm_hz(Channel3::new(gpiob.pb10), 100.kHz(), &clocks)
5353
.split();
54+
motor_pwm.enable();
5455
let mut motor = Motor::new(motor_in1, motor_in2, motor_pwm);
5556
motor.drive_backwards(0).expect("");
5657

0 commit comments

Comments
 (0)