aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUlf Lilleengen <[email protected]>2022-01-12 12:43:24 +0100
committerUlf Lilleengen <[email protected]>2022-01-12 14:28:10 +0100
commit2bc105803ab5ad176978a56aa90ad03b276bfc47 (patch)
tree0638a2e801daa5302f9ae5f033b691bec859475d
parente7668a86bd118ae8c4eb3e695130d7cac90c1dfe (diff)
Make exti an optional feature
* Add embassy-stm32 build with exti * Add exti to examples
-rwxr-xr-xci.sh6
-rw-r--r--embassy-stm32/Cargo.toml1
-rw-r--r--embassy-stm32/src/gpio.rs3
-rw-r--r--embassy-stm32/src/lib.rs4
-rw-r--r--examples/stm32f3/Cargo.toml2
-rw-r--r--examples/stm32f4/Cargo.toml2
-rw-r--r--examples/stm32f7/Cargo.toml4
-rw-r--r--examples/stm32g0/Cargo.toml2
-rw-r--r--examples/stm32g4/Cargo.toml2
-rw-r--r--examples/stm32h7/Cargo.toml4
-rw-r--r--examples/stm32l0/Cargo.toml2
-rw-r--r--examples/stm32l4/Cargo.toml2
-rw-r--r--examples/stm32wb55/Cargo.toml2
-rw-r--r--examples/stm32wl55/Cargo.toml2
14 files changed, 24 insertions, 14 deletions
diff --git a/ci.sh b/ci.sh
index ccd7e2559..e1783e4e0 100755
--- a/ci.sh
+++ b/ci.sh
@@ -48,6 +48,12 @@ cargo batch \
48 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt \ 48 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt \
49 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt \ 49 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt \
50 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt \ 50 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt \
51 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f411ce,defmt,exti \
52 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32f429zi,log,exti \
53 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32h755zi-cm7,defmt,exti \
54 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7em-none-eabi --features stm32l476vg,defmt,exti \
55 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv6m-none-eabi --features stm32l072cz,defmt,exti \
56 --- build --release --manifest-path embassy-stm32/Cargo.toml --target thumbv7m-none-eabi --features stm32l151cb-a,defmt,exti \
51 --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \ 57 --- build --release --manifest-path docs/modules/ROOT/examples/basic/Cargo.toml --target thumbv7em-none-eabi \
52 --- build --release --manifest-path examples/std/Cargo.toml --target x86_64-unknown-linux-gnu --out-dir out/examples/std \ 58 --- build --release --manifest-path examples/std/Cargo.toml --target x86_64-unknown-linux-gnu --out-dir out/examples/std \
53 --- build --release --manifest-path examples/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/nrf \ 59 --- build --release --manifest-path examples/nrf/Cargo.toml --target thumbv7em-none-eabi --out-dir out/examples/nrf \
diff --git a/embassy-stm32/Cargo.toml b/embassy-stm32/Cargo.toml
index 264005850..ee5e7b173 100644
--- a/embassy-stm32/Cargo.toml
+++ b/embassy-stm32/Cargo.toml
@@ -41,6 +41,7 @@ sdmmc-rs = ["embedded-sdmmc"]
41net = ["embassy-net", "vcell"] 41net = ["embassy-net", "vcell"]
42memory-x = ["stm32-metapac/memory-x"] 42memory-x = ["stm32-metapac/memory-x"]
43subghz = [] 43subghz = []
44exti = []
44 45
45# Features starting with `_` are for internal use only. They're not intended 46# Features starting with `_` are for internal use only. They're not intended
46# to be enabled by other crates, and are not covered by semver guarantees. 47# to be enabled by other crates, and are not covered by semver guarantees.
diff --git a/embassy-stm32/src/gpio.rs b/embassy-stm32/src/gpio.rs
index 49a109847..1b257c386 100644
--- a/embassy-stm32/src/gpio.rs
+++ b/embassy-stm32/src/gpio.rs
@@ -480,6 +480,7 @@ pub(crate) mod sealed {
480} 480}
481 481
482pub trait Pin: sealed::Pin + Sized { 482pub trait Pin: sealed::Pin + Sized {
483 #[cfg(feature = "exti")]
483 type ExtiChannel: crate::exti::Channel; 484 type ExtiChannel: crate::exti::Channel;
484 485
485 /// Number of the pin within the port (0..31) 486 /// Number of the pin within the port (0..31)
@@ -527,6 +528,7 @@ impl AnyPin {
527 528
528unsafe_impl_unborrow!(AnyPin); 529unsafe_impl_unborrow!(AnyPin);
529impl Pin for AnyPin { 530impl Pin for AnyPin {
531 #[cfg(feature = "exti")]
530 type ExtiChannel = crate::exti::AnyChannel; 532 type ExtiChannel = crate::exti::AnyChannel;
531} 533}
532impl sealed::Pin for AnyPin { 534impl sealed::Pin for AnyPin {
@@ -589,6 +591,7 @@ impl OptionalPin for NoPin {
589crate::pac::pins!( 591crate::pac::pins!(
590 ($pin_name:ident, $port_name:ident, $port_num:expr, $pin_num:expr, $exti_ch:ident) => { 592 ($pin_name:ident, $port_name:ident, $port_num:expr, $pin_num:expr, $exti_ch:ident) => {
591 impl Pin for peripherals::$pin_name { 593 impl Pin for peripherals::$pin_name {
594 #[cfg(feature = "exti")]
592 type ExtiChannel = peripherals::$exti_ch; 595 type ExtiChannel = peripherals::$exti_ch;
593 } 596 }
594 impl sealed::Pin for peripherals::$pin_name { 597 impl sealed::Pin for peripherals::$pin_name {
diff --git a/embassy-stm32/src/lib.rs b/embassy-stm32/src/lib.rs
index bcd9bd5c1..1ed48df3f 100644
--- a/embassy-stm32/src/lib.rs
+++ b/embassy-stm32/src/lib.rs
@@ -33,7 +33,7 @@ pub mod dac;
33pub mod dcmi; 33pub mod dcmi;
34#[cfg(all(eth, feature = "net"))] 34#[cfg(all(eth, feature = "net"))]
35pub mod eth; 35pub mod eth;
36#[cfg(exti)] 36#[cfg(feature = "exti")]
37pub mod exti; 37pub mod exti;
38#[cfg(i2c)] 38#[cfg(i2c)]
39pub mod i2c; 39pub mod i2c;
@@ -99,7 +99,7 @@ pub fn init(config: Config) -> Peripherals {
99 99
100 gpio::init(); 100 gpio::init();
101 dma::init(); 101 dma::init();
102 #[cfg(exti)] 102 #[cfg(feature = "exti")]
103 exti::init(); 103 exti::init();
104 104
105 rcc::init(config.rcc); 105 rcc::init(config.rcc);
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml
index cd9cd3a8f..fdc627f2e 100644
--- a/examples/stm32f3/Cargo.toml
+++ b/examples/stm32f3/Cargo.toml
@@ -8,7 +8,7 @@ resolver = "2"
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f303vc", "unstable-pac", "memory-x", "time-driver-tim2"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f303vc", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] }
12 12
13defmt = "0.3" 13defmt = "0.3"
14defmt-rtt = "0.3" 14defmt-rtt = "0.3"
diff --git a/examples/stm32f4/Cargo.toml b/examples/stm32f4/Cargo.toml
index 807dfef1c..c75491081 100644
--- a/examples/stm32f4/Cargo.toml
+++ b/examples/stm32f4/Cargo.toml
@@ -9,7 +9,7 @@ resolver = "2"
9[dependencies] 9[dependencies]
10embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 10embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
11embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 11embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
12embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-tim2"] } 12embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32f429zi", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] }
13 13
14defmt = "0.3" 14defmt = "0.3"
15defmt-rtt = "0.3" 15defmt-rtt = "0.3"
diff --git a/examples/stm32f7/Cargo.toml b/examples/stm32f7/Cargo.toml
index 607622471..d9c7a67e5 100644
--- a/examples/stm32f7/Cargo.toml
+++ b/examples/stm32f7/Cargo.toml
@@ -8,7 +8,7 @@ resolver = "2"
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-tim2"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "net", "stm32f767zi", "unstable-pac", "time-driver-tim2", "exti"] }
12embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] } 12embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
13 13
14defmt = "0.3" 14defmt = "0.3"
@@ -27,4 +27,4 @@ critical-section = "0.2.3"
27[dependencies.smoltcp] 27[dependencies.smoltcp]
28version = "0.8.0" 28version = "0.8.0"
29default-features = false 29default-features = false
30features = ["defmt"] \ No newline at end of file 30features = ["defmt"]
diff --git a/examples/stm32g0/Cargo.toml b/examples/stm32g0/Cargo.toml
index 6b249ee0d..511d99689 100644
--- a/examples/stm32g0/Cargo.toml
+++ b/examples/stm32g0/Cargo.toml
@@ -8,7 +8,7 @@ resolver = "2"
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "time-driver-tim2", "stm32g071rb", "memory-x", "unstable-pac"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "time-driver-tim2", "stm32g071rb", "memory-x", "unstable-pac", "exti"] }
12 12
13defmt = "0.3" 13defmt = "0.3"
14defmt-rtt = "0.3" 14defmt-rtt = "0.3"
diff --git a/examples/stm32g4/Cargo.toml b/examples/stm32g4/Cargo.toml
index f4378309a..a0a2e4650 100644
--- a/examples/stm32g4/Cargo.toml
+++ b/examples/stm32g4/Cargo.toml
@@ -8,7 +8,7 @@ resolver = "2"
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "time-driver-tim3", "stm32g491re", "memory-x", "unstable-pac"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "time-driver-tim3", "stm32g491re", "memory-x", "unstable-pac", "exti"] }
12embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" } 12embassy-hal-common = {version = "0.1.0", path = "../../embassy-hal-common" }
13 13
14defmt = "0.3" 14defmt = "0.3"
diff --git a/examples/stm32h7/Cargo.toml b/examples/stm32h7/Cargo.toml
index 364a28de7..a34ac6ad9 100644
--- a/examples/stm32h7/Cargo.toml
+++ b/examples/stm32h7/Cargo.toml
@@ -10,7 +10,7 @@ resolver = "2"
10[dependencies] 10[dependencies]
11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
12embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 12embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743zi", "net", "time-driver-tim2"] } 13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32h743zi", "net", "time-driver-tim2", "exti"] }
14embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] } 14embassy-net = { path = "../../embassy-net", default-features = false, features = ["defmt", "tcp", "medium-ethernet", "pool-16"] }
15 15
16defmt = "0.3" 16defmt = "0.3"
@@ -67,4 +67,4 @@ debug-assertions = false # <-
67incremental = false 67incremental = false
68lto = 'fat' 68lto = 'fat'
69opt-level = 3 # <- 69opt-level = 3 # <-
70overflow-checks = false # <- \ No newline at end of file 70overflow-checks = false # <-
diff --git a/examples/stm32l0/Cargo.toml b/examples/stm32l0/Cargo.toml
index ed977db8d..7056d580a 100644
--- a/examples/stm32l0/Cargo.toml
+++ b/examples/stm32l0/Cargo.toml
@@ -8,7 +8,7 @@ resolver = "2"
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-tim3"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32l072cz", "time-driver-tim3", "exti"] }
12 12
13embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time", "defmt"] } 13embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["sx127x", "time", "defmt"] }
14 14
diff --git a/examples/stm32l4/Cargo.toml b/examples/stm32l4/Cargo.toml
index 3891f41a1..71086961d 100644
--- a/examples/stm32l4/Cargo.toml
+++ b/examples/stm32l4/Cargo.toml
@@ -10,7 +10,7 @@ resolver = "2"
10[dependencies] 10[dependencies]
11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt" ] } 11embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt" ] }
12embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 12embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "unstable-pac", "stm32l4s5vi", "time-driver-tim2"] } 13embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "unstable-pac", "stm32l4s5vi", "time-driver-tim2", "exti"] }
14 14
15defmt = "0.3" 15defmt = "0.3"
16defmt-rtt = "0.3" 16defmt-rtt = "0.3"
diff --git a/examples/stm32wb55/Cargo.toml b/examples/stm32wb55/Cargo.toml
index 3b977f387..03826e476 100644
--- a/examples/stm32wb55/Cargo.toml
+++ b/examples/stm32wb55/Cargo.toml
@@ -8,7 +8,7 @@ resolver = "2"
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wb55cc", "time-driver-tim2"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wb55cc", "time-driver-tim2", "exti"] }
12 12
13defmt = "0.3" 13defmt = "0.3"
14defmt-rtt = "0.3" 14defmt-rtt = "0.3"
diff --git a/examples/stm32wl55/Cargo.toml b/examples/stm32wl55/Cargo.toml
index 504c1070c..dd55554d2 100644
--- a/examples/stm32wl55/Cargo.toml
+++ b/examples/stm32wl55/Cargo.toml
@@ -8,7 +8,7 @@ resolver = "2"
8[dependencies] 8[dependencies]
9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] } 9embassy = { version = "0.1.0", path = "../../embassy", features = ["defmt"] }
10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] } 10embassy-traits = { version = "0.1.0", path = "../../embassy-traits", features = ["defmt"] }
11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-tim2", "memory-x", "subghz", "unstable-pac"] } 11embassy-stm32 = { version = "0.1.0", path = "../../embassy-stm32", features = ["defmt", "stm32wl55jc-cm4", "time-driver-tim2", "memory-x", "subghz", "unstable-pac", "exti"] }
12embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time"] } 12embassy-lora = { version = "0.1.0", path = "../../embassy-lora", features = ["stm32wl", "time"] }
13 13
14lorawan-device = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "0de1a2a31933f7c97887b5718c1755fa5ab93a42", default-features = false, features = ["async"] } 14lorawan-device = { git = "https://github.com/ivajloip/rust-lorawan.git", rev = "0de1a2a31933f7c97887b5718c1755fa5ab93a42", default-features = false, features = ["async"] }