aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xci.sh1
-rw-r--r--embassy-stm32/Cargo.toml15
-rw-r--r--embassy-stm32/src/exti.rs2
-rw-r--r--embassy-stm32/src/rcc/mod.rs9
-rw-r--r--embassy-stm32/src/rcc/wl.rs (renamed from embassy-stm32/src/rcc/wl5.rs)0
-rw-r--r--stm32-gen-features/src/lib.rs44
6 files changed, 25 insertions, 46 deletions
diff --git a/ci.sh b/ci.sh
index 8f375eb92..116b6a319 100755
--- a/ci.sh
+++ b/ci.sh
@@ -57,6 +57,7 @@ cargo batch \
57 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f217zg,defmt,exti,time-driver-any,unstable-traits \ 57 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features nightly,stm32f217zg,defmt,exti,time-driver-any,unstable-traits \
58 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,stm32l552ze,defmt,exti,time-driver-any,unstable-traits \ 58 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv8m.main-none-eabihf --features nightly,stm32l552ze,defmt,exti,time-driver-any,unstable-traits \
59 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32wl54jc-cm0p,defmt,exti,time-driver-any,unstable-traits \ 59 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features nightly,stm32wl54jc-cm0p,defmt,exti,time-driver-any,unstable-traits \
60 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features nightly,stm32wle5ub,defmt,exti,time-driver-any,unstable-traits \
60 --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \ 61 --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \
61 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \ 62 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-pac/Cargo.toml --target thumbv7em-none-eabi \
62 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \ 63 --- build --release --manifest-path docs/modules/ROOT/examples/layer-by-layer/blinky-hal/Cargo.toml --target thumbv7em-none-eabi \
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index 030782466..037d32751 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -26,6 +26,7 @@ flavors = [
26 { regex_feature = "stm32l0.*", target = "thumbv6m-none-eabi" }, 26 { regex_feature = "stm32l0.*", target = "thumbv6m-none-eabi" },
27 { regex_feature = "stm32l1.*", target = "thumbv7m-none-eabi" }, 27 { regex_feature = "stm32l1.*", target = "thumbv7m-none-eabi" },
28 { regex_feature = "stm32l4.*", target = "thumbv7em-none-eabi" }, 28 { regex_feature = "stm32l4.*", target = "thumbv7em-none-eabi" },
29 { regex_feature = "stm32l5.*", target = "thumbv8m.main-none-eabihf" },
29 { regex_feature = "stm32u5.*", target = "thumbv8m.main-none-eabihf" }, 30 { regex_feature = "stm32u5.*", target = "thumbv8m.main-none-eabihf" },
30 { regex_feature = "stm32wb.*", target = "thumbv7em-none-eabi" }, 31 { regex_feature = "stm32wb.*", target = "thumbv7em-none-eabi" },
31 { regex_feature = "stm32wl.*", target = "thumbv7em-none-eabi" }, 32 { regex_feature = "stm32wl.*", target = "thumbv7em-none-eabi" },
@@ -1343,4 +1344,18 @@ stm32wl55jc-cm4 = [ "stm32-metapac/stm32wl55jc-cm4" ]
1343stm32wl55jc-cm0p = [ "stm32-metapac/stm32wl55jc-cm0p" ] 1344stm32wl55jc-cm0p = [ "stm32-metapac/stm32wl55jc-cm0p" ]
1344stm32wl55uc-cm4 = [ "stm32-metapac/stm32wl55uc-cm4" ] 1345stm32wl55uc-cm4 = [ "stm32-metapac/stm32wl55uc-cm4" ]
1345stm32wl55uc-cm0p = [ "stm32-metapac/stm32wl55uc-cm0p" ] 1346stm32wl55uc-cm0p = [ "stm32-metapac/stm32wl55uc-cm0p" ]
1347stm32wle4c8 = [ "stm32-metapac/stm32wle4c8" ]
1348stm32wle4cb = [ "stm32-metapac/stm32wle4cb" ]
1349stm32wle4cc = [ "stm32-metapac/stm32wle4cc" ]
1350stm32wle4j8 = [ "stm32-metapac/stm32wle4j8" ]
1351stm32wle4jb = [ "stm32-metapac/stm32wle4jb" ]
1352stm32wle4jc = [ "stm32-metapac/stm32wle4jc" ]
1353stm32wle5c8 = [ "stm32-metapac/stm32wle5c8" ]
1354stm32wle5cb = [ "stm32-metapac/stm32wle5cb" ]
1355stm32wle5cc = [ "stm32-metapac/stm32wle5cc" ]
1356stm32wle5j8 = [ "stm32-metapac/stm32wle5j8" ]
1357stm32wle5jb = [ "stm32-metapac/stm32wle5jb" ]
1358stm32wle5jc = [ "stm32-metapac/stm32wle5jc" ]
1359stm32wle5u8 = [ "stm32-metapac/stm32wle5u8" ]
1360stm32wle5ub = [ "stm32-metapac/stm32wle5ub" ]
1346# END GENERATED FEATURES 1361# END GENERATED FEATURES
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs
index 8858bb648..957a1ca55 100644
--- a/embassy-stm32/src/exti.rs
+++ b/embassy-stm32/src/exti.rs
@@ -371,7 +371,7 @@ pub(crate) unsafe fn init() {
371 371
372 foreach_exti_irq!(enable_irq); 372 foreach_exti_irq!(enable_irq);
373 373
374 #[cfg(not(any(rcc_wb, rcc_wl5, rcc_f1)))] 374 #[cfg(not(any(rcc_wb, rcc_wl5, rcc_wle, rcc_f1)))]
375 <crate::peripherals::SYSCFG as crate::rcc::sealed::RccPeripheral>::enable(); 375 <crate::peripherals::SYSCFG as crate::rcc::sealed::RccPeripheral>::enable();
376 #[cfg(stm32f1)] 376 #[cfg(stm32f1)]
377 <crate::peripherals::AFIO as crate::rcc::sealed::RccPeripheral>::enable(); 377 <crate::peripherals::AFIO as crate::rcc::sealed::RccPeripheral>::enable();
diff --git a/embassy-stm32/src/rcc/mod.rs b/embassy-stm32/src/rcc/mod.rs
index 37ecf8fba..d0ae2fc79 100644
--- a/embassy-stm32/src/rcc/mod.rs
+++ b/embassy-stm32/src/rcc/mod.rs
@@ -18,7 +18,7 @@ use core::mem::MaybeUninit;
18#[cfg_attr(rcc_l5, path = "l5.rs")] 18#[cfg_attr(rcc_l5, path = "l5.rs")]
19#[cfg_attr(rcc_u5, path = "u5.rs")] 19#[cfg_attr(rcc_u5, path = "u5.rs")]
20#[cfg_attr(rcc_wb, path = "wb.rs")] 20#[cfg_attr(rcc_wb, path = "wb.rs")]
21#[cfg_attr(rcc_wl5, path = "wl5.rs")] 21#[cfg_attr(any(rcc_wl5, rcc_wle), path = "wl.rs")]
22mod _version; 22mod _version;
23pub use _version::*; 23pub use _version::*;
24 24
@@ -33,7 +33,7 @@ pub struct Clocks {
33 pub apb2: Hertz, 33 pub apb2: Hertz,
34 #[cfg(not(rcc_g0))] 34 #[cfg(not(rcc_g0))]
35 pub apb2_tim: Hertz, 35 pub apb2_tim: Hertz,
36 #[cfg(any(rcc_wl5, rcc_u5))] 36 #[cfg(any(rcc_wl5, rcc_wle, rcc_u5))]
37 pub apb3: Hertz, 37 pub apb3: Hertz,
38 #[cfg(any(rcc_h7, rcc_h7ab))] 38 #[cfg(any(rcc_h7, rcc_h7ab))]
39 pub apb4: Hertz, 39 pub apb4: Hertz,
@@ -42,11 +42,12 @@ pub struct Clocks {
42 pub ahb1: Hertz, 42 pub ahb1: Hertz,
43 #[cfg(any( 43 #[cfg(any(
44 rcc_l4, rcc_l5, rcc_f2, rcc_f4, rcc_f410, rcc_f7, rcc_h7, rcc_h7ab, rcc_g4, rcc_u5, rcc_wb, 44 rcc_l4, rcc_l5, rcc_f2, rcc_f4, rcc_f410, rcc_f7, rcc_h7, rcc_h7ab, rcc_g4, rcc_u5, rcc_wb,
45 rcc_wl5 45 rcc_wl5, rcc_wle
46 ))] 46 ))]
47 pub ahb2: Hertz, 47 pub ahb2: Hertz,
48 #[cfg(any( 48 #[cfg(any(
49 rcc_l4, rcc_l5, rcc_f2, rcc_f4, rcc_f410, rcc_f7, rcc_h7, rcc_h7ab, rcc_u5, rcc_wb, rcc_wl5 49 rcc_l4, rcc_l5, rcc_f2, rcc_f4, rcc_f410, rcc_f7, rcc_h7, rcc_h7ab, rcc_u5, rcc_wb,
50 rcc_wl5, rcc_wle
50 ))] 51 ))]
51 pub ahb3: Hertz, 52 pub ahb3: Hertz,
52 #[cfg(any(rcc_h7, rcc_h7ab))] 53 #[cfg(any(rcc_h7, rcc_h7ab))]
diff --git a/embassy-stm32/src/rcc/wl5.rs b/embassy-stm32/src/rcc/wl.rs
index fb2dd9986..fb2dd9986 100644
--- a/embassy-stm32/src/rcc/wl5.rs
+++ b/embassy-stm32/src/rcc/wl.rs
diff --git a/stm32-gen-features/src/lib.rs b/stm32-gen-features/src/lib.rs
index bef11c2ad..7aaad9da3 100644
--- a/stm32-gen-features/src/lib.rs
+++ b/stm32-gen-features/src/lib.rs
@@ -1,38 +1,11 @@
1//! FIXME discuss about which errors to print and when to panic 1//! FIXME discuss about which errors to print and when to panic
2 2
3use std::{iter::FilterMap, path::Path, slice::Iter}; 3use std::path::Path;
4
5const SUPPORTED_FAMILIES: &[&str] = &[
6 "stm32f0", "stm32f1", "stm32f2", "stm32f3", "stm32f4", "stm32f7", "stm32g0", "stm32g4",
7 "stm32l0", "stm32l1", "stm32l4", "stm32l5", "stm32h7", "stm32u5", "stm32wb", "stm32wl5",
8];
9 4
10const SEPARATOR_START: &str = "# BEGIN GENERATED FEATURES\n"; 5const SEPARATOR_START: &str = "# BEGIN GENERATED FEATURES\n";
11const SEPARATOR_END: &str = "# END GENERATED FEATURES\n"; 6const SEPARATOR_END: &str = "# END GENERATED FEATURES\n";
12const HELP: &str = "# Generated by stm32-gen-features. DO NOT EDIT.\n"; 7const HELP: &str = "# Generated by stm32-gen-features. DO NOT EDIT.\n";
13 8
14/// True if the chip named `name` is supported else false
15fn is_supported(name: &str) -> bool {
16 SUPPORTED_FAMILIES
17 .iter()
18 .any(|family| name.starts_with(family))
19}
20
21type SupportedIter<'a> = FilterMap<
22 Iter<'a, (String, Vec<String>)>,
23 fn(&(String, Vec<String>)) -> Option<(&String, &Vec<String>)>,
24>;
25trait FilterSupported {
26 fn supported(&self) -> SupportedIter;
27}
28impl FilterSupported for &[(String, Vec<String>)] {
29 /// Get a new Vec with only the supported chips
30 fn supported(&self) -> SupportedIter {
31 self.iter()
32 .filter_map(|(name, cores)| is_supported(name).then(|| (name, cores)))
33 }
34}
35
36/// Get the list of all the chips and their supported cores 9/// Get the list of all the chips and their supported cores
37/// 10///
38/// Print errors to `stderr` when something is returned by the glob but is not in the returned 11/// Print errors to `stderr` when something is returned by the glob but is not in the returned
@@ -85,7 +58,7 @@ fn chip_cores(path: &Path) -> Vec<String> {
85/// Panics if a file contains yaml syntax errors or if a value does not have a consistent type 58/// Panics if a file contains yaml syntax errors or if a value does not have a consistent type
86pub fn embassy_stm32_needed_data(names_and_cores: &[(String, Vec<String>)]) -> String { 59pub fn embassy_stm32_needed_data(names_and_cores: &[(String, Vec<String>)]) -> String {
87 let mut result = String::new(); 60 let mut result = String::new();
88 for (chip_name, cores) in names_and_cores.supported() { 61 for (chip_name, cores) in names_and_cores {
89 if cores.len() > 1 { 62 if cores.len() > 1 {
90 for core_name in cores.iter() { 63 for core_name in cores.iter() {
91 result += &format!( 64 result += &format!(
@@ -151,21 +124,10 @@ mod tests {
151 use super::*; 124 use super::*;
152 125
153 #[test] 126 #[test]
154 fn stm32f407vg_is_supported() {
155 assert!(is_supported("stm32f407vg"))
156 }
157
158 #[test]
159 fn abcdef_is_not_supported() {
160 assert!(!is_supported("abcdef"))
161 }
162
163 #[test]
164 #[ignore] 127 #[ignore]
165 fn stm32f407vg_yaml_file_exists_and_is_supported() { 128 fn stm32f407vg_yaml_file_exists() {
166 assert!(chip_names_and_cores() 129 assert!(chip_names_and_cores()
167 .as_slice() 130 .as_slice()
168 .supported()
169 .into_iter() 131 .into_iter()
170 .any(|(name, _)| { name == "stm32f407vg" })) 132 .any(|(name, _)| { name == "stm32f407vg" }))
171 } 133 }