diff options
Diffstat (limited to 'examples/stm32f3')
| -rw-r--r-- | examples/stm32f3/Cargo.toml | 24 | ||||
| -rw-r--r-- | examples/stm32f3/src/bin/button_events.rs | 4 | ||||
| -rw-r--r-- | examples/stm32f3/src/bin/multiprio.rs | 6 |
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" | |||
| 3 | name = "embassy-stm32f3-examples" | 3 | name = "embassy-stm32f3-examples" |
| 4 | version = "0.1.0" | 4 | version = "0.1.0" |
| 5 | license = "MIT OR Apache-2.0" | 5 | license = "MIT OR Apache-2.0" |
| 6 | publish = 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. |
| 9 | embassy-stm32 = { version = "0.2.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] } | 10 | embassy-stm32 = { version = "0.4.0", path = "../../embassy-stm32", features = [ "defmt", "stm32f303ze", "unstable-pac", "memory-x", "time-driver-tim2", "exti"] } |
| 10 | embassy-sync = { version = "0.6.2", path = "../../embassy-sync", features = ["defmt"] } | 11 | embassy-sync = { version = "0.7.2", path = "../../embassy-sync", features = ["defmt"] } |
| 11 | embassy-executor = { version = "0.7.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } | 12 | embassy-executor = { version = "0.9.0", path = "../../embassy-executor", features = ["arch-cortex-m", "executor-thread", "executor-interrupt", "defmt"] } |
| 12 | embassy-time = { version = "0.4.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } | 13 | embassy-time = { version = "0.5.0", path = "../../embassy-time", features = ["defmt", "defmt-timestamp-uptime", "tick-hz-32_768"] } |
| 13 | embassy-usb = { version = "0.4.0", path = "../../embassy-usb", features = ["defmt"] } | 14 | embassy-usb = { version = "0.5.1", path = "../../embassy-usb", features = ["defmt"] } |
| 14 | embassy-futures = { version = "0.1.0", path = "../../embassy-futures" } | 15 | embassy-futures = { version = "0.1.2", path = "../../embassy-futures" } |
| 15 | 16 | ||
| 16 | defmt = "0.3" | 17 | defmt = "1.0.1" |
| 17 | defmt-rtt = "0.4" | 18 | defmt-rtt = "1.0.0" |
| 18 | 19 | ||
| 19 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } | 20 | cortex-m = { version = "0.7.6", features = ["inline-asm", "critical-section-single-core"] } |
| 20 | cortex-m-rt = "0.7.0" | 21 | cortex-m-rt = "0.7.0" |
| 21 | embedded-hal = "0.2.6" | 22 | embedded-hal = "0.2.6" |
| 22 | panic-probe = { version = "0.3", features = ["print-defmt"] } | 23 | panic-probe = { version = "1.0.0", features = ["print-defmt"] } |
| 23 | heapless = { version = "0.8", default-features = false } | 24 | heapless = { version = "0.8", default-features = false } |
| 24 | nb = "1.0.0" | 25 | nb = "1.0.0" |
| 25 | embedded-storage = "0.3.1" | 26 | embedded-storage = "0.3.1" |
| @@ -27,3 +28,8 @@ static_cell = "2" | |||
| 27 | 28 | ||
| 28 | [profile.release] | 29 | [profile.release] |
| 29 | debug = 2 | 30 | debug = 2 |
| 31 | |||
| 32 | [package.metadata.embassy] | ||
| 33 | build = [ | ||
| 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 | } |
