Skip to content

Commit fa9ab1c

Browse files
committed
Update device select error conditions
1 parent 0241609 commit fa9ab1c

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

src/lib.rs

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,22 @@
4646
#![warn(missing_docs)]
4747
#![deny(macro_use_extern_crate)]
4848

49-
#[cfg(all(not(feature = "device-selected"), not(feature = "needs-subvariant")))]
49+
#[cfg(all(feature = "direct-call-deprecated", not(feature = "device-selected")))]
50+
compile_error!(
51+
"The feature you selected is deprecated, because it was split up into sub-devices.
52+
53+
Example: The STM32F3Discovery board has a STM32F303VCT6 chip.
54+
You probably used to use `--features stm32f303` but now functionalities for the sub-device were added.
55+
In this case replace it with `--features stm32f303xc` to make your code build again.
56+
57+
Please select one of the chip features stated above."
58+
);
59+
60+
// TODO Remove because, as of stm32f3 v0.12, this will be caught by it's build.rs?
61+
#[cfg(all(
62+
not(feature = "direct-call-deprecated"),
63+
not(feature = "device-selected")
64+
))]
5065
compile_error!(
5166
"This crate requires you to specify your target chip as a feature.
5267
@@ -81,17 +96,6 @@ compile_error!(
8196
"
8297
);
8398

84-
#[cfg(all(not(feature = "device-selected"), feature = "direct-call-deprecated",))]
85-
compile_error!(
86-
"The feature you selected is deprecated, because it was split up into sub-devices.
87-
88-
Example: The STM32F3Discovery board has a STM32F303VCT6 chip.
89-
You probably used to use `--features stm32f303` but now functionalities for the sub-device were added.
90-
In this case replace it with `--features stm32f303xc` to make your code build again.
91-
92-
Please select one of the chip features stated above."
93-
);
94-
9599
pub use embedded_hal as hal;
96100

97101
pub use nb;

0 commit comments

Comments
 (0)