Skip to content

Commit 864d433

Browse files
committed
Split all device features
1 parent 09b15bd commit 864d433

File tree

5 files changed

+218
-182
lines changed

5 files changed

+218
-182
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,34 @@ jobs:
1212
strategy:
1313
matrix:
1414
mcu:
15-
- stm32f301
16-
- stm32f318
15+
- stm32f301x6
16+
- stm32f318x8
17+
- stm32f302x6
18+
# - stm32f302x8
1719
- stm32f302xb
18-
- stm32f302xc
20+
# - stm32f302xc
1921
- stm32f302xd
20-
- stm32f302xe
21-
- stm32f302x6
22-
- stm32f302x8
22+
# - stm32f302xe
23+
- stm32f303x6
24+
# - stm32f303x8
2325
- stm32f303xb
24-
- stm32f303xc
26+
# - stm32f303xc
2527
- stm32f303xd
26-
- stm32f303xe
27-
- stm32f303x6
28-
- stm32f303x8
29-
- stm32f373
30-
- stm32f378
31-
- stm32f334
32-
- stm32f328
33-
- stm32f358
34-
- stm32f398
28+
# - stm32f303xe
29+
- stm32f328x8
30+
- stm32f358xc
31+
- stm32f398xe
32+
- stm32f373x8
33+
# - stm32f373xb
34+
# - stm32f373xc
35+
- stm32f378xc
36+
- stm32f334x4
37+
# - stm32f334x6
38+
# - stm32f334x8
3539
features: ["rt"]
3640
include:
3741
- mcu: stm32f303xc
38-
features: rt,stm32-usbd
42+
features: rt,can,stm32-usbd
3943
steps:
4044
- uses: actions/checkout@v2
4145
- uses: actions-rs/toolchain@v1

Cargo.toml

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,12 @@ direct-call-deprecated = []
6969
rt = ["stm32f3/rt"]
7070
can = ["embedded-hal-can"]
7171

72+
svd-f301 = ["stm32f3/stm32f301"]
73+
svd-f302 = ["stm32f3/stm32f302"]
74+
svd-f303 = ["stm32f3/stm32f303"]
75+
svd-f373 = ["stm32f3/stm32f373"]
76+
svd-f3x4 = ["stm32f3/stm32f3x4"]
77+
7278
gpio-f302 = []
7379
gpio-f303 = []
7480
gpio-f303e = []
@@ -77,28 +83,41 @@ gpio-f373 = []
7783

7884
# Any changes here should be mirrored in README.md, src/lib.rs, and
7985
# .github/workflows/ci.yml.
80-
stm32f301 = ["gpio-f302", "stm32f3/stm32f301", "device-selected"]
81-
stm32f318 = ["gpio-f302", "stm32f3/stm32f301", "device-selected"]
82-
stm32f302 = ["stm32f3/stm32f302", "direct-call-deprecated"]
86+
stm32f301 = ["svd-f301", "direct-call-deprecated"]
87+
stm32f301x6 = ["stm32f301", "gpio-f302", "device-selected"]
88+
stm32f301x8 = ["stm32f301", "gpio-f302", "device-selected"]
89+
stm32f318 = ["svd-f301", "direct-call-deprecated"]
90+
stm32f318x8 = ["stm32f318", "gpio-f302", "device-selected"]
91+
stm32f302 = ["svd-f302", "direct-call-deprecated"]
8392
stm32f302x6 = ["stm32f302", "gpio-f302", "device-selected"]
8493
stm32f302x8 = ["stm32f302", "gpio-f302", "device-selected"]
8594
stm32f302xb = ["stm32f302", "gpio-f303", "device-selected"]
8695
stm32f302xc = ["stm32f302", "gpio-f303", "device-selected"]
8796
stm32f302xd = ["stm32f302", "gpio-f303e", "device-selected"]
8897
stm32f302xe = ["stm32f302", "gpio-f303e", "device-selected"]
89-
stm32f303 = ["stm32f3/stm32f303", "direct-call-deprecated"]
98+
stm32f303 = ["svd-f303", "direct-call-deprecated"]
9099
stm32f303x6 = ["stm32f303", "gpio-f333", "device-selected"]
91100
stm32f303x8 = ["stm32f303", "gpio-f333", "device-selected"]
92101
stm32f303xb = ["stm32f303", "gpio-f303", "device-selected"]
93102
stm32f303xc = ["stm32f303", "gpio-f303", "device-selected"]
94103
stm32f303xd = ["stm32f303", "gpio-f303e", "device-selected"]
95104
stm32f303xe = ["stm32f303", "gpio-f303e", "device-selected"]
96-
stm32f328 = ["gpio-f333", "stm32f3/stm32f303", "device-selected"]
97-
stm32f358 = ["gpio-f303", "stm32f3/stm32f303", "device-selected"]
98-
stm32f398 = ["gpio-f303e", "stm32f3/stm32f303", "device-selected"]
99-
stm32f373 = ["gpio-f373", "stm32f3/stm32f373", "device-selected"]
100-
stm32f378 = ["gpio-f373", "stm32f3/stm32f373", "device-selected"]
101-
stm32f334 = ["gpio-f333", "stm32f3/stm32f3x4", "device-selected"]
105+
stm32f328 = ["svd-f303", "direct-call-deprecated"]
106+
stm32f328x8 = ["stm32f328", "gpio-f333", "device-selected"]
107+
stm32f358 = ["svd-f303", "direct-call-deprecated"]
108+
stm32f358xc = ["stm32f358", "gpio-f303", "device-selected"]
109+
stm32f398 = ["svd-f303", "direct-call-deprecated"]
110+
stm32f398xe = ["stm32f398", "gpio-f303e", "device-selected"]
111+
stm32f373 = ["svd-f373", "direct-call-deprecated"]
112+
stm32f373x8 = ["stm32f373", "gpio-f373", "device-selected"]
113+
stm32f373xb = ["stm32f373", "gpio-f373", "device-selected"]
114+
stm32f373xc = ["stm32f373", "gpio-f373", "device-selected"]
115+
stm32f378 = ["svd-f373", "direct-call-deprecated"]
116+
stm32f378xc = ["stm32f378", "gpio-f373", "device-selected"]
117+
stm32f334 = ["svd-f3x4", "direct-call-deprecated"]
118+
stm32f334x4 = ["stm32f334", "gpio-f333", "device-selected"]
119+
stm32f334x6 = ["stm32f334", "gpio-f333", "device-selected"]
120+
stm32f334x8 = ["stm32f334", "gpio-f333", "device-selected"]
102121

103122
defmt-default = ["defmt"]
104123
defmt-trace = ["defmt"]

README.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,31 @@ So you want to expand your call to `cargo` with `--features stm32f303xc`.*
5353

5454
Note: `x` denotes any character in [a-z]
5555

56-
* stm32f301xb
57-
* stm32f301xc
58-
* stm32f301xd
59-
* stm32f301xe
60-
* stm32f318
56+
* stm32f301x6
57+
* stm32f301x8
58+
* stm32f318x8
59+
* stm32f302x6
60+
* stm32f302x8
6161
* stm32f302xb
6262
* stm32f302xc
6363
* stm32f302xd
6464
* stm32f302xe
65-
* stm32f302x6
66-
* stm32f302x8
65+
* stm32f303x6
66+
* stm32f303x8
6767
* stm32f303xb
6868
* stm32f303xc
6969
* stm32f303xd
7070
* stm32f303xe
71-
* stm32f303x6
72-
* stm32f303x8
73-
* stm32f373
74-
* stm32f378
75-
* stm32f334
76-
* stm32f328
77-
* stm32f358
78-
* stm32f398
71+
* stm32f328x8
72+
* stm32f358xc
73+
* stm32f398xe
74+
* stm32f373x8
75+
* stm32f373xb
76+
* stm32f373xc
77+
* stm32f378xc
78+
* stm32f334x4
79+
* stm32f334x6
80+
* stm32f334x8
7981

8082
### Background
8183

src/gpio.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -533,15 +533,15 @@ where
533533
}
534534

535535
/// Return an EXTI register for the current CPU
536-
#[cfg(any(feature = "stm32f373", feature = "stm32f378"))]
536+
#[cfg(feature = "svd-f373")]
537537
macro_rules! reg_for_cpu {
538538
($exti:expr, $xr:ident) => {
539539
$exti.$xr
540540
};
541541
}
542542

543543
/// Return an EXTI register for the current CPU
544-
#[cfg(not(any(feature = "stm32f373", feature = "stm32f378")))]
544+
#[cfg(not(feature = "svd-f373"))]
545545
macro_rules! reg_for_cpu {
546546
($exti:expr, $xr:ident) => {
547547
paste::paste! {
@@ -561,15 +561,15 @@ where
561561
match self.index.index() {
562562
0 => Interrupt::EXTI0,
563563
1 => Interrupt::EXTI1,
564-
#[cfg(any(feature = "stm32f373", feature = "stm32f378"))]
564+
#[cfg(feature = "svd-f373")]
565565
2 => Interrupt::EXTI2_TS,
566-
#[cfg(not(any(feature = "stm32f373", feature = "stm32f378")))]
566+
#[cfg(not(feature = "svd-f373"))]
567567
2 => Interrupt::EXTI2_TSC,
568568
3 => Interrupt::EXTI3,
569569
4 => Interrupt::EXTI4,
570-
#[cfg(any(feature = "stm32f373", feature = "stm32f378"))]
570+
#[cfg(feature = "svd-f373")]
571571
5..=9 => Interrupt::EXTI5_9,
572-
#[cfg(not(any(feature = "stm32f373", feature = "stm32f378")))]
572+
#[cfg(not(feature = "svd-f373"))]
573573
5..=9 => Interrupt::EXTI9_5,
574574
10..=15 => Interrupt::EXTI15_10,
575575
_ => unreachable!(),

0 commit comments

Comments
 (0)