Skip to content

Commit ec801f0

Browse files
committed
Make hrtim optional
1 parent 417e364 commit ec801f0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ usb = ["dep:stm32-usbd"]
8282
stm32g431 = ["stm32g4/stm32g431", "cat2"]
8383
stm32g441 = ["stm32g4/stm32g441", "cat2"]
8484
stm32g473 = ["stm32g4/stm32g473", "cat3", "adc3", "adc4", "adc5"]
85-
stm32g474 = ["stm32g4/stm32g474", "cat3", "adc3", "adc4", "adc5", "hrtim", "stm32-hrtim/stm32g474"]
85+
stm32g474 = ["stm32g4/stm32g474", "cat3", "adc3", "adc4", "adc5", "stm32-hrtim/stm32g474"]
8686
stm32g483 = ["stm32g4/stm32g483", "cat3", "adc3", "adc4", "adc5"]
87-
stm32g484 = ["stm32g4/stm32g484", "cat3", "adc3", "adc4", "adc5", "hrtim", "stm32-hrtim/stm32g484"]
87+
stm32g484 = ["stm32g4/stm32g484", "cat3", "adc3", "adc4", "adc5", "stm32-hrtim/stm32g484"]
8888
stm32g491 = ["stm32g4/stm32g491", "cat4", "adc3"]
8989
stm32g4a1 = ["stm32g4/stm32g4a1", "cat4", "adc3"]
9090

@@ -119,7 +119,7 @@ cat3 = ["gpio-g47x"]
119119
cat4 = ["gpio-g49x"]
120120

121121
can = ["dep:fdcan"]
122-
hrtim = ["dep:stm32-hrtim"]
122+
hrtim = ["dep:stm32-hrtim"] # Only available for stm32g474 and stm32g484
123123

124124
[profile.dev]
125125
codegen-units = 1

src/lib.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ pub mod syscfg;
9393
pub mod time;
9494
pub mod timer;
9595
// pub mod watchdog;
96+
97+
#[cfg(all(feature = "hrtim", not(any(feature = "stm32g474", feature = "stm32g484"))))]
98+
compile_error!("`hrtim` is only available for stm32g474 and stm32g484");
99+
96100
#[cfg(feature = "hrtim")]
97101
pub mod hrtim;
98102
pub mod independent_watchdog;

0 commit comments

Comments
 (0)