You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
i had forgotten to completely remove the dependency in the now reverted
commit, thus the optional dependency still created a feature which
consuming crates could enable. removing it would be a breaking change.
this leaves two options:
* remove the `defmt` _dependency_ and add a dummy _feature_ of the same
name, issuing a compile warning if it is enabled, eventually removing
it in v2.0 if or when that will ever be released
* accept the fact that we already have the optional dependency and thus
the feature and make use of it
this contains a few changes to the reverted commit:
* the feature is now called `defmt` rather than `defmt-03` (as that's
the name of the implicit feature for the optional dependency)
* the `debug` output in `drive` is kept but downgraded to `trace` and
slightly reworded (the speed is already present in the command)
* the `cfg`-guarded `use` is removed to make the code cleaner
This reverts commit d9da807.
(with minor adaptations)
Copy file name to clipboardExpand all lines: README.md
+3Lines changed: 3 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,9 @@ See the documentation for usage examples.
20
20
* You plan on using a single motor with the standby feature: use `Motor` and control the standby pin manually
21
21
* You plan on using a single motor without the standby feature: use `Motor`
22
22
23
+
## Optional features
24
+
*`defmt`: you can enable this feature to get a `defmt::Format` implementation for all structs & enums in this crate and a `defmt::trace` call for every speed change.
25
+
23
26
## Examples
24
27
A simple example for the STM32F4 microcontrollers is [available](examples/stm32f4-single-motor-example/README.md).
Copy file name to clipboardExpand all lines: src/lib.rs
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -9,6 +9,9 @@
9
9
//! * You plan on using both motors without the standby feature: use two separate [`Motor`]s
10
10
//! * You plan on using a single motor with the standby feature: use [`Motor`] and control the standby pin manually
11
11
//! * You plan on using a single motor without the standby feature: use [`Motor`]
12
+
//!
13
+
//! ## Optional features
14
+
//! * `defmt`: you can enable this feature to get a `defmt::Format` implementation for all structs & enums in this crate and a `defmt::trace` call for every speed change.
12
15
13
16
#![forbid(unsafe_code)]
14
17
#![deny(warnings)]
@@ -24,6 +27,7 @@ use embedded_hal::pwm::SetDutyCycle;
24
27
25
28
/// Defines errors which can happen when calling [`Motor::drive()`].
0 commit comments