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
As we are now using build.rs to check the feature selection,
we can now make more sophisticated checks.
Therefor we use build.rs to compare the selected features
and the features in the Cargo.toml (via cargo_metadata),
and verify, that only a single valid device feature is selected.
For more information, see \x1b]8;;https://github.com/stm32-rs/stm32f3xx-hal#selecting-the-right-chip\x1b\\README -> Selecting the right chip\x1b]8;;\x1b\\."
23
-
);
24
-
}else{
25
-
eprintln!(
26
-
"This crate requires you to specify your target chip as a feature.
54
+
// get all selected features via env variables
55
+
let selected_features:HashSet<String> = env::vars()
56
+
.filter_map(|(key, _)| {
57
+
key.split("CARGO_FEATURE_")
58
+
.nth(1)
59
+
.map(|s| s.to_owned().to_ascii_lowercase())
60
+
})
61
+
.collect();
27
62
28
-
Please select one of the following (`x` denotes any character in [a-z]):
let device_variants = device_variants.linear_group_by(|a, b| a[..9] == b[..9]);
43
75
44
-
For more information, see \x1b]8;;https://github.com/stm32-rs/stm32f3xx-hal#selecting-the-right-chip\x1b\\README -> Selecting the right chip\x1b]8;;\x1b\\."
45
-
);
76
+
// pretty print all avaliable devices
77
+
for line in device_variants {
78
+
for device in line {
79
+
eprint!("{} ", device);
80
+
}
81
+
eprintln!();
46
82
}
83
+
84
+
eprintln!(
85
+
"\nExample: The STM32F3Discovery board has a STM32F303VCT6 chip.\n\
86
+
So you need to specify stm32f303xc in your Cargo.toml (note that VC → xc).\n\
0 commit comments