Skip to content

Commit 0705ad1

Browse files
authored
chrono: move to a non-default feature
1 parent 01c2e2b commit 0705ad1

File tree

12 files changed

+30
-15
lines changed

12 files changed

+30
-15
lines changed

.cargo/config.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ test-subghz = "test -p testsuite --target thumbv7em-none-eabi --bin subghz"
2929
test-uart = "test -p testsuite --target thumbv7em-none-eabi --bin uart"
3030

3131
# e.g. cargo unit
32-
unit = "test --features stm32wl5x_cm4"
33-
unit-little = "test --features stm32wl5x_cm0p"
32+
unit = "test --features stm32wl5x_cm4,chrono,embedded-time"
33+
unit-little = "test --features stm32wl5x_cm0p,chrono,embedded-time"
3434
unit-nucleo = "test -p nucleo-wl55jc-bsp --features stm32wl5x_cm4"
3535
unit-lora-e5 = "test -p lora-e5-bsp"

.github/workflows/ci.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,16 +139,16 @@ jobs:
139139
toolchain: stable
140140

141141
- name: Test HAL
142-
run: cargo test --features ${{ matrix.mcu }},embedded-time
142+
run: cargo test --features ${{ matrix.mcu }},embedded-time,chrono
143143

144144
- name: Test nucleo BSP
145145
if: ${{ startsWith(matrix.mcu, 'stm32wl5x') }}
146146
run: |
147-
cargo test -p nucleo-wl55jc-bsp --features ${{ matrix.mcu }},embedded-time
147+
cargo test -p nucleo-wl55jc-bsp --features ${{ matrix.mcu }},embedded-time,chrono
148148
149149
- name: Test LoRa E5 BSP
150150
if: ${{ matrix.mcu == 'stm32wle5' }}
151-
run: cargo test -p lora-e5-bsp --features embedded-time
151+
run: cargo test -p lora-e5-bsp --features embedded-time,chrono
152152

153153
clippy:
154154
name: Clippy
@@ -202,7 +202,7 @@ jobs:
202202
run: |
203203
cd hal
204204
cargo +nightly rustdoc \
205-
--features embedded-time,rt,stm32wl5x_cm4 \
205+
--features chrono,embedded-time,rt,stm32wl5x_cm4 \
206206
-- -Z unstable-options --enable-index-page
207207
- name: deploy
208208
if: ${{ github.ref == 'refs/heads/main' }}

.vscode/settings.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
2-
"rust-analyzer.cargo.features": ["stm32wl5x_cm4", "rt"],
2+
"rust-analyzer.cargo.features": ["stm32wl5x_cm4", "rt", "chrono"],
33
"rust-analyzer.cargo.allFeatures": false,
4-
"rust-analyzer.checkOnSave.features": ["stm32wl5x_cm4", "rt"],
4+
"rust-analyzer.checkOnSave.features": ["stm32wl5x_cm4", "rt", "chrono"],
55
"rust-analyzer.checkOnSave.allFeatures": false,
66
"rust-analyzer.checkOnSave.allTargets": false,
77
"rust-analyzer.cargo.target": "thumbv7em-none-eabi",

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2323
- Moved `info::package` to `info::Package::from_device`.
2424
- Moved `info::uid` to `info::Uid::from_device`.
2525
- Added `#[inline]` to `util::new_delay` and `util::reset_cycle_count`.
26-
- `embedded-time` is now an optional feature.
27-
- Changed `I2C::new` to use `u32` instead of `embedded_time::Hertz`.
26+
- Large dependencies are now optional.
27+
- `embedded-time` is now an optional feature.
28+
- Changed `I2C::new` to use `u32` instead of `embedded_time::Hertz`.
29+
- `chrono` is now an optional feature.
2830

2931
## [0.2.1] - 2021-11-20
3032
### Fixed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,8 @@ features = [
4040
"defmt",
4141
# optional: enable conversions with embedded-time types
4242
"embedded-time",
43+
# optional: use the real time clock (RTC)
44+
"chrono",
4345
]
4446
```
4547

hal/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ rt = ["stm32wl/rt", "cortex-m-rt"]
2020

2121
[dependencies]
2222
cfg-if = "1"
23-
chrono = { version = "0.4", default-features = false }
23+
chrono = { version = "0.4", default-features = false, optional = true }
2424
cortex-m = "0.7.2"
2525
cortex-m-rt = { version = "0.7", optional = true }
2626
defmt = { version = "0.3", optional = true }
@@ -38,5 +38,5 @@ static_assertions = "1"
3838

3939
[package.metadata.docs.rs]
4040
all-features = false
41-
features = ["stm32wl5x_cm4", "rt", "embedded-time"]
41+
features = ["stm32wl5x_cm4", "rt", "embedded-time", "chrono"]
4242
rustdoc-args = ["--cfg", "docsrs"]

hal/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ pub mod pka;
5959
pub mod pwr;
6060
pub mod rcc;
6161
pub mod rng;
62+
#[cfg(feature = "chrono")]
6263
pub mod rtc;
6364
pub mod spi;
6465
pub mod subghz;
@@ -71,6 +72,7 @@ pub use ratio::Ratio;
7172
#[cfg(feature = "rt")]
7273
pub use cortex_m_rt;
7374

75+
#[cfg(feature = "chrono")]
7476
pub use chrono;
7577
pub use cortex_m;
7678
pub use embedded_hal;

lora-e5-bsp/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ categories = ["embedded", "hardware-support", "no-std"]
1313
repository = "https://github.com/stm32-rs/stm32wlxx-hal"
1414

1515
[features]
16+
chrono = ["stm32wlxx-hal/chrono"]
1617
defmt = ["stm32wlxx-hal/defmt", "dfmt"]
1718
embedded-time = ["stm32wlxx-hal/embedded-time"]
1819
rt = ["stm32wlxx-hal/rt"]
@@ -29,5 +30,5 @@ optional = true
2930

3031
[package.metadata.docs.rs]
3132
all-features = false
32-
features = ["rt", "embedded-time"]
33+
features = ["rt", "embedded-time", "chrono"]
3334
rustdoc-args = ["--cfg", "docsrs"]

lora-e5-bsp/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ features = [
1616
"defmt",
1717
# optional: enable conversions with embedded-time types
1818
"embedded-time",
19+
# optional: use the real time clock (RTC)
20+
"chrono",
1921
]
2022
```
2123

nucleo-wl55jc-bsp/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ categories = ["embedded", "hardware-support", "no-std"]
1313
repository = "https://github.com/stm32-rs/stm32wlxx-hal"
1414

1515
[features]
16+
chrono = ["stm32wlxx-hal/chrono"]
1617
defmt = ["stm32wlxx-hal/defmt", "dfmt"]
1718
embedded-time = ["stm32wlxx-hal/embedded-time"]
1819
rt = ["stm32wlxx-hal/rt"]
@@ -30,5 +31,5 @@ optional = true
3031

3132
[package.metadata.docs.rs]
3233
all-features = false
33-
features = ["stm32wl5x_cm4", "rt", "embedded-time"]
34+
features = ["stm32wl5x_cm4", "rt", "embedded-time", "chrono"]
3435
rustdoc-args = ["--cfg", "docsrs"]

0 commit comments

Comments
 (0)