diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2023-04-07 00:29:18 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-04-07 00:29:18 +0000 |
| commit | 047ea9066f0d946fd4d706577b21df38fd3b1647 (patch) | |
| tree | efaa85e242b87a6ec2c4b0098d75916b92279a24 | |
| parent | da8258b7673a52a4639818f9c3f3b7ea241b4799 (diff) | |
| parent | f38899728c8bc9c81c4ac02d8177ec6420c07f02 (diff) | |
Merge #1335
1335: Misc stm32 fixes r=Dirbaio a=Dirbaio
bors r+
Co-authored-by: Dario Nieuwenhuis <[email protected]>
| -rw-r--r-- | embassy-lora/Cargo.toml | 2 | ||||
| -rw-r--r-- | embassy-stm32/Cargo.toml | 7 | ||||
| -rw-r--r-- | embassy-stm32/src/lib.rs | 5 | ||||
| -rw-r--r-- | embassy-stm32/src/usb_otg/mod.rs | 6 | ||||
| -rw-r--r-- | examples/stm32wl/Cargo.toml | 2 |
5 files changed, 12 insertions, 10 deletions
diff --git a/embassy-lora/Cargo.toml b/embassy-lora/Cargo.toml index c9174ea82..784cc228d 100644 --- a/embassy-lora/Cargo.toml +++ b/embassy-lora/Cargo.toml | |||
| @@ -19,7 +19,7 @@ flavors = [ | |||
| 19 | [features] | 19 | [features] |
| 20 | sx126x = [] | 20 | sx126x = [] |
| 21 | sx127x = [] | 21 | sx127x = [] |
| 22 | stm32wl = ["embassy-stm32", "embassy-stm32/subghz"] | 22 | stm32wl = ["dep:embassy-stm32"] |
| 23 | time = [] | 23 | time = [] |
| 24 | defmt = ["dep:defmt", "lorawan/defmt", "lorawan-device/defmt"] | 24 | defmt = ["dep:defmt", "lorawan/defmt", "lorawan-device/defmt"] |
| 25 | 25 | ||
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml index 6710ff2d0..4ab306223 100644 --- a/embassy-stm32/Cargo.toml +++ b/embassy-stm32/Cargo.toml | |||
| @@ -8,10 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-stm32-v$VERSION/embassy-stm32/src/" | 8 | src_base = "https://github.com/embassy-rs/embassy/blob/embassy-stm32-v$VERSION/embassy-stm32/src/" |
| 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32/src/" | 9 | src_base_git = "https://github.com/embassy-rs/embassy/blob/$COMMIT/embassy-stm32/src/" |
| 10 | 10 | ||
| 11 | # TODO: sdmmc | 11 | features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any", "time"] |
| 12 | # TODO: net | ||
| 13 | # TODO: subghz | ||
| 14 | features = ["nightly", "defmt", "unstable-pac", "unstable-traits", "exti", "time-driver-any"] | ||
| 15 | flavors = [ | 12 | flavors = [ |
| 16 | { regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" }, | 13 | { regex_feature = "stm32f0.*", target = "thumbv6m-none-eabi" }, |
| 17 | { regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" }, | 14 | { regex_feature = "stm32f1.*", target = "thumbv7m-none-eabi" }, |
| @@ -22,6 +19,7 @@ flavors = [ | |||
| 22 | { regex_feature = "stm32c0.*", target = "thumbv6m-none-eabi" }, | 19 | { regex_feature = "stm32c0.*", target = "thumbv6m-none-eabi" }, |
| 23 | { regex_feature = "stm32g0.*", target = "thumbv6m-none-eabi" }, | 20 | { regex_feature = "stm32g0.*", target = "thumbv6m-none-eabi" }, |
| 24 | { regex_feature = "stm32g4.*", target = "thumbv7em-none-eabi" }, | 21 | { regex_feature = "stm32g4.*", target = "thumbv7em-none-eabi" }, |
| 22 | { regex_feature = "stm32h5.*", target = "thumbv8m.main-none-eabihf" }, | ||
| 25 | { regex_feature = "stm32h7.*", target = "thumbv7em-none-eabi" }, | 23 | { regex_feature = "stm32h7.*", target = "thumbv7em-none-eabi" }, |
| 26 | { regex_feature = "stm32l0.*", target = "thumbv6m-none-eabi" }, | 24 | { regex_feature = "stm32l0.*", target = "thumbv6m-none-eabi" }, |
| 27 | { regex_feature = "stm32l1.*", target = "thumbv7m-none-eabi" }, | 25 | { regex_feature = "stm32l1.*", target = "thumbv7m-none-eabi" }, |
| @@ -81,7 +79,6 @@ stm32-metapac = { version = "4", default-features = false, features = ["metadata | |||
| 81 | default = ["stm32-metapac/rt"] | 79 | default = ["stm32-metapac/rt"] |
| 82 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-sync/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embassy-hal-common/defmt", "embedded-io?/defmt", "embassy-usb-driver?/defmt", "embassy-net-driver/defmt"] | 80 | defmt = ["dep:defmt", "bxcan/unstable-defmt", "embassy-sync/defmt", "embassy-executor/defmt", "embassy-embedded-hal/defmt", "embassy-hal-common/defmt", "embedded-io?/defmt", "embassy-usb-driver?/defmt", "embassy-net-driver/defmt"] |
| 83 | memory-x = ["stm32-metapac/memory-x"] | 81 | memory-x = ["stm32-metapac/memory-x"] |
| 84 | subghz = [] | ||
| 85 | exti = [] | 82 | exti = [] |
| 86 | 83 | ||
| 87 | # Enables additional driver features that depend on embassy-time | 84 | # Enables additional driver features that depend on embassy-time |
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs index 3f2d078f8..d4d7155bd 100644 --- a/embassy-stm32/src/lib.rs +++ b/embassy-stm32/src/lib.rs | |||
| @@ -53,6 +53,8 @@ pub mod rng; | |||
| 53 | pub mod sdmmc; | 53 | pub mod sdmmc; |
| 54 | #[cfg(spi)] | 54 | #[cfg(spi)] |
| 55 | pub mod spi; | 55 | pub mod spi; |
| 56 | #[cfg(stm32wl)] | ||
| 57 | pub mod subghz; | ||
| 56 | #[cfg(usart)] | 58 | #[cfg(usart)] |
| 57 | pub mod usart; | 59 | pub mod usart; |
| 58 | #[cfg(all(usb, feature = "time"))] | 60 | #[cfg(all(usb, feature = "time"))] |
| @@ -62,9 +64,6 @@ pub mod usb_otg; | |||
| 62 | #[cfg(iwdg)] | 64 | #[cfg(iwdg)] |
| 63 | pub mod wdg; | 65 | pub mod wdg; |
| 64 | 66 | ||
| 65 | #[cfg(feature = "subghz")] | ||
| 66 | pub mod subghz; | ||
| 67 | |||
| 68 | // This must go last, so that it sees all the impl_foo! macros defined earlier. | 67 | // This must go last, so that it sees all the impl_foo! macros defined earlier. |
| 69 | pub(crate) mod _generated { | 68 | pub(crate) mod _generated { |
| 70 | #![allow(dead_code)] | 69 | #![allow(dead_code)] |
diff --git a/embassy-stm32/src/usb_otg/mod.rs b/embassy-stm32/src/usb_otg/mod.rs index 84fef78cb..193e0df0d 100644 --- a/embassy-stm32/src/usb_otg/mod.rs +++ b/embassy-stm32/src/usb_otg/mod.rs | |||
| @@ -89,6 +89,9 @@ foreach_interrupt!( | |||
| 89 | } else if #[cfg(stm32h7)] { | 89 | } else if #[cfg(stm32h7)] { |
| 90 | const FIFO_DEPTH_WORDS: u16 = 1024; | 90 | const FIFO_DEPTH_WORDS: u16 = 1024; |
| 91 | const ENDPOINT_COUNT: usize = 9; | 91 | const ENDPOINT_COUNT: usize = 9; |
| 92 | } else if #[cfg(stm32u5)] { | ||
| 93 | const FIFO_DEPTH_WORDS: u16 = 320; | ||
| 94 | const ENDPOINT_COUNT: usize = 6; | ||
| 92 | } else { | 95 | } else { |
| 93 | compile_error!("USB_OTG_FS peripheral is not supported by this chip."); | 96 | compile_error!("USB_OTG_FS peripheral is not supported by this chip."); |
| 94 | } | 97 | } |
| @@ -137,6 +140,9 @@ foreach_interrupt!( | |||
| 137 | ))] { | 140 | ))] { |
| 138 | const FIFO_DEPTH_WORDS: u16 = 1024; | 141 | const FIFO_DEPTH_WORDS: u16 = 1024; |
| 139 | const ENDPOINT_COUNT: usize = 9; | 142 | const ENDPOINT_COUNT: usize = 9; |
| 143 | } else if #[cfg(stm32u5)] { | ||
| 144 | const FIFO_DEPTH_WORDS: u16 = 1024; | ||
| 145 | const ENDPOINT_COUNT: usize = 9; | ||
| 140 | } else { | 146 | } else { |
| 141 | compile_error!("USB_OTG_HS peripheral is not supported by this chip."); | 147 | compile_error!("USB_OTG_HS peripheral is not supported by this chip."); |
| 142 | } | 148 | } |
diff --git a/examples/stm32wl/Cargo.toml b/examples/stm32wl/Cargo.toml index 9fc7e0f4a..0d2194ea2 100644 --- a/examples/stm32wl/Cargo.toml +++ b/examples/stm32wl/Cargo.toml | |||
| @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0" | |||
| 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } | 8 | embassy-sync = { version = "0.1.0", path = "../../embassy-sync", features = ["defmt"] } |
| 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } | 9 | embassy-executor = { version = "0.1.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "defmt", "integrated-timers"] } |
| 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 10 | embassy-time = { version = "0.1.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "subghz", "unstable-pac", "exti"] } | 11 | embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["nightly", "defmt", "stm32wl55jc-cm4", "time-driver-any", "memory-x", "unstable-pac", "exti"] } |
| 12 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] } | 12 | embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time", "defmt"] } |
| 13 | 13 | ||
| 14 | lorawan-device = { version = "0.8.0", default-features = false, features = ["async"] } | 14 | lorawan-device = { version = "0.8.0", default-features = false, features = ["async"] } |
