aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f3
diff options
context:
space:
mode:
Diffstat (limited to 'examples/stm32f3')
-rw-r--r--examples/stm32f3/Cargo.toml24
-rw-r--r--examples/stm32f3/src/bin/button_events.rs4
-rw-r--r--examples/stm32f3/src/bin/multiprio.rs6
3 files changed, 20 insertions, 14 deletions
diff --git a/examples/stm32f3/Cargo.toml b/examples/stm32f3/Cargo.toml
index 31bf040b0..23025ef0b 100644
--- a/examples/stm32f3/Cargo.toml
+++ b/examples/stm32f3/Cargo.toml
@@ -3,23 +3,24 @@ edition = "2021"
3name = "embassy-stm32f3-examples" 3name = "embassy-stm32f3-examples"
4version = "0.1.0" 4version = "0.1.0"
5license = "MIT OR Apache-2.0" 5license = "MIT OR Apache-2.0"
6publish = false
6 7
7[dependencies] 8[dependencies]
8# Change stm32f303ze to your chip name, if necessary. 9# Change stm32f303ze to your chip name, if necessary.
9embassy-stm32 = { version = "0.2.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] } 10embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] }
10embassy-sync = { version = "0.6.2", path = "../../embassy-sync", features = ["defmt"] } 11embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] }
11embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } 12embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] }
12embassy-time = { version = "0.4.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } 13embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] }
13embassy-usb = { version = "0.4.0", path = "../../embassy-usb", features = ["defmt"] } 14embassy-usb = { version = "0.5.1", path = "../../embassy-usb", features = ["defmt"] }
14embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } 15embassy-futures = { version = "0.1.2", path = "../../embassy-futures" }
15 16
16defmt = "0.3" 17defmt = "1.0.1"
17defmt-rtt = "0.4" 18defmt-rtt = "1.0.0"
18 19
19cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } 20cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] }
20cortex-m-rt = "0.7.0" 21cortex-m-rt = "0.7.0"
21embedded-hal = "0.2.6" 22embedded-hal = "0.2.6"
22panic-probe = { version = "0.3", features = ["print-defmt"] } 23panic-probe = { version = "1.0.0", features = ["print-defmt"] }
23heapless = { version = "0.8", default-features = false } 24heapless = { version = "0.8", default-features = false }
24nb = "1.0.0" 25nb = "1.0.0"
25embedded-storage = "0.3.1" 26embedded-storage = "0.3.1"
@@ -27,3 +28,8 @@ static_cell = "2"
27 28
28[profile.release] 29[profile.release]
29debug = 2 30debug = 2
31
32[package.metadata.embassy]
33build = [
34 { target = "thumbv7em-none-eabi", artifact-dir = "out/examples/stm32f3" }
35]
diff --git a/examples/stm32f3/src/bin/button_events.rs b/examples/stm32f3/src/bin/button_events.rs
index f5ed5d2c9..a54d03212 100644
--- a/examples/stm32f3/src/bin/button_events.rs
+++ b/examples/stm32f3/src/bin/button_events.rs
@@ -113,8 +113,8 @@ async fn main(spawner: Spawner) {
113 ]; 113 ];
114 let leds = Leds::new(leds); 114 let leds = Leds::new(leds);
115 115
116 spawner.spawn(button_waiter(button)).unwrap(); 116 spawner.spawn(button_waiter(button).unwrap());
117 spawner.spawn(led_blinker(leds)).unwrap(); 117 spawner.spawn(led_blinker(leds).unwrap());
118} 118}
119 119
120#[embassy_executor::task] 120#[embassy_executor::task]
diff --git a/examples/stm32f3/src/bin/multiprio.rs b/examples/stm32f3/src/bin/multiprio.rs
index b4620888f..2f2ffdea2 100644
--- a/examples/stm32f3/src/bin/multiprio.rs
+++ b/examples/stm32f3/src/bin/multiprio.rs
@@ -135,16 +135,16 @@ fn main() -> ! {
135 // High-priority executor: UART4, priority level 6 135 // High-priority executor: UART4, priority level 6
136 interrupt::UART4.set_priority(Priority::P6); 136 interrupt::UART4.set_priority(Priority::P6);
137 let spawner = EXECUTOR_HIGH.start(interrupt::UART4); 137 let spawner = EXECUTOR_HIGH.start(interrupt::UART4);
138 unwrap!(spawner.spawn(run_high())); 138 spawner.spawn(unwrap!(run_high()));
139 139
140 // Medium-priority executor: UART5, priority level 7 140 // Medium-priority executor: UART5, priority level 7
141 interrupt::UART5.set_priority(Priority::P7); 141 interrupt::UART5.set_priority(Priority::P7);
142 let spawner = EXECUTOR_MED.start(interrupt::UART5); 142 let spawner = EXECUTOR_MED.start(interrupt::UART5);
143 unwrap!(spawner.spawn(run_med())); 143 spawner.spawn(unwrap!(run_med()));
144 144
145 // Low priority executor: runs in thread mode, using WFE/SEV 145 // Low priority executor: runs in thread mode, using WFE/SEV
146 let executor = EXECUTOR_LOW.init(Executor::new()); 146 let executor = EXECUTOR_LOW.init(Executor::new());
147 executor.run(|spawner| { 147 executor.run(|spawner| {
148 unwrap!(spawner.spawn(run_low())); 148 spawner.spawn(unwrap!(run_low()));
149 }); 149 });
150} 150}