Skip to content

Commit 7dced36

Browse files
bors[bot]jkristell
andauthored
Merge #465
465: Fix defmt support r=burrbull a=jkristell Right now on relase 0.12 (and master) this: ``` DEFMT_LOG=debug cargo build --release --features=rt,stm32f405,defmt --examples ``` fails to compile due to `defmt` support in fugit not being enabled. This workaround fixes that, but feels like a hack. It's described here: https://blog.turbo.fish/cargo-features/ The other option is to rename the fugit feature under a different name, but this fix could be used until then. Let me know if you want this to be merged and I can write a Changelog entry. Co-authored-by: Johan Kristell <[email protected]>
2 parents 3a87906 + c29aee6 commit 7dced36

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1111

1212
- Move pin mode at the end of generics, add defaults for modes,
1313
bump MSRV to 1.59 [#418]
14+
- Move hd44780-driver to dev-dependencies
15+
16+
### Fixed
17+
- Enable the defmt feature on fugit when the defmt feature on the
18+
crate is enabled
1419

1520
### Added
1621

Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ features = ["stm32f429", "rt", "usb_fs", "can", "i2s", "fsmc_lcd"]
2727
targets = ["thumbv7em-none-eabihf"]
2828

2929
[dependencies]
30-
defmt = { version = "0.3.0", optional = true }
30+
defmt_ = { package = "defmt", version = "0.3.0", optional = true }
3131
bxcan = { version = "0.6", optional = true }
3232
cortex-m = "0.7.4"
3333
cortex-m-rt = "0.7"
@@ -46,7 +46,6 @@ fugit-timer = "0.1.3"
4646
rtic-monotonic = { version = "1.0", optional = true }
4747
bitflags = "1.3.2"
4848
embedded-storage = "0.2"
49-
hd44780-driver = "0.4.0"
5049

5150
[dependencies.time]
5251
version = "0.3"
@@ -80,6 +79,7 @@ display-interface-spi = "0.4"
8079
ist7920 = "0.1.0"
8180
smart-leds = "0.3.0"
8281
ws2812-spi = { version = "0.4.0", features = [] }
82+
hd44780-driver = "0.4.0"
8383

8484
[dev-dependencies.time]
8585
version = "0.3"
@@ -324,6 +324,8 @@ i2s = ["stm32_i2s_v12x"]
324324

325325
fsmc_lcd = ["display-interface"]
326326

327+
defmt = ["defmt_", "fugit/defmt"]
328+
327329
adc2 = []
328330
adc3 = []
329331
can1 = []

src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
#![no_std]
22
#![allow(non_camel_case_types)]
33

4+
#[cfg(feature = "defmt")]
5+
extern crate defmt_ as defmt;
6+
47
#[cfg(not(feature = "device-selected"))]
58
compile_error!(
69
"This crate requires one of the following device features enabled:

0 commit comments

Comments
 (0)