diff options
| author | Thales Fragoso <[email protected]> | 2021-03-18 22:23:09 -0300 |
|---|---|---|
| committer | Thales Fragoso <[email protected]> | 2021-03-18 22:37:08 -0300 |
| commit | 88a25b042aee96a73bdfbc44409bd8f6cd15035a (patch) | |
| tree | 7ab313f59c039764374257a1a8fcc29d5f214ae3 /embassy-stm32f4-examples | |
| parent | 456e04c79fb5070fadffa6e80832e78aec7c2e59 (diff) | |
F4: Fix compilation for other MCUs
Diffstat (limited to 'embassy-stm32f4-examples')
| -rw-r--r-- | embassy-stm32f4-examples/Cargo.toml | 22 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/src/bin/can.rs | 4 | ||||
| -rw-r--r-- | embassy-stm32f4-examples/src/bin/serial.rs | 2 |
3 files changed, 22 insertions, 6 deletions
diff --git a/embassy-stm32f4-examples/Cargo.toml b/embassy-stm32f4-examples/Cargo.toml index 60ba44554..5bbaecc58 100644 --- a/embassy-stm32f4-examples/Cargo.toml +++ b/embassy-stm32f4-examples/Cargo.toml | |||
| @@ -15,11 +15,29 @@ defmt-info = [] | |||
| 15 | defmt-warn = [] | 15 | defmt-warn = [] |
| 16 | defmt-error = [] | 16 | defmt-error = [] |
| 17 | 17 | ||
| 18 | stm32f401 = ["stm32f4xx-hal/stm32f401", "embassy-stm32f4/stm32f401"] | ||
| 19 | stm32f405 = ["stm32f4xx-hal/stm32f405", "embassy-stm32f4/stm32f405"] | ||
| 20 | stm32f407 = ["stm32f4xx-hal/stm32f407", "embassy-stm32f4/stm32f407"] | ||
| 21 | stm32f410 = ["stm32f4xx-hal/stm32f410", "embassy-stm32f4/stm32f410"] | ||
| 22 | stm32f411 = ["stm32f4xx-hal/stm32f411", "embassy-stm32f4/stm32f411"] | ||
| 23 | stm32f412 = ["stm32f4xx-hal/stm32f412", "embassy-stm32f4/stm32f412"] | ||
| 24 | stm32f413 = ["stm32f4xx-hal/stm32f413", "embassy-stm32f4/stm32f413"] | ||
| 25 | stm32f415 = ["stm32f4xx-hal/stm32f405", "embassy-stm32f4/stm32f405"] | ||
| 26 | stm32f417 = ["stm32f4xx-hal/stm32f407", "embassy-stm32f4/stm32f407"] | ||
| 27 | stm32f423 = ["stm32f4xx-hal/stm32f413", "embassy-stm32f4/stm32f413"] | ||
| 28 | stm32f427 = ["stm32f4xx-hal/stm32f427", "embassy-stm32f4/stm32f427"] | ||
| 29 | stm32f429 = ["stm32f4xx-hal/stm32f429", "embassy-stm32f4/stm32f429"] | ||
| 30 | stm32f437 = ["stm32f4xx-hal/stm32f427", "embassy-stm32f4/stm32f427"] | ||
| 31 | stm32f439 = ["stm32f4xx-hal/stm32f429", "embassy-stm32f4/stm32f429"] | ||
| 32 | stm32f446 = ["stm32f4xx-hal/stm32f446", "embassy-stm32f4/stm32f446"] | ||
| 33 | stm32f469 = ["stm32f4xx-hal/stm32f469", "embassy-stm32f4/stm32f469"] | ||
| 34 | stm32f479 = ["stm32f4xx-hal/stm32f469", "embassy-stm32f4/stm32f469"] | ||
| 35 | |||
| 18 | 36 | ||
| 19 | [dependencies] | 37 | [dependencies] |
| 20 | embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } | 38 | embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] } |
| 21 | embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] } | 39 | embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] } |
| 22 | embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4", features = ["stm32f405"] } | 40 | embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4" } |
| 23 | 41 | ||
| 24 | defmt = "0.2.0" | 42 | defmt = "0.2.0" |
| 25 | defmt-rtt = "0.2.0" | 43 | defmt-rtt = "0.2.0" |
| @@ -28,7 +46,7 @@ cortex-m = "0.7.1" | |||
| 28 | cortex-m-rt = "0.6.13" | 46 | cortex-m-rt = "0.6.13" |
| 29 | embedded-hal = { version = "0.2.4" } | 47 | embedded-hal = { version = "0.2.4" } |
| 30 | panic-probe = "0.1.0" | 48 | panic-probe = "0.1.0" |
| 31 | stm32f4xx-hal = { version = "0.8.3", features = ["rt", "stm32f405"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git"} | 49 | stm32f4xx-hal = { version = "0.8.3", features = ["rt"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git"} |
| 32 | futures = { version = "0.3.8", default-features = false, features = ["async-await"] } | 50 | futures = { version = "0.3.8", default-features = false, features = ["async-await"] } |
| 33 | rtt-target = { version = "0.3", features = ["cortex-m"] } | 51 | rtt-target = { version = "0.3", features = ["cortex-m"] } |
| 34 | bxcan = "0.5.0" \ No newline at end of file | 52 | bxcan = "0.5.0" \ No newline at end of file |
diff --git a/embassy-stm32f4-examples/src/bin/can.rs b/embassy-stm32f4-examples/src/bin/can.rs index 701a277ec..5ffde2471 100644 --- a/embassy-stm32f4-examples/src/bin/can.rs +++ b/embassy-stm32f4-examples/src/bin/can.rs | |||
| @@ -12,10 +12,8 @@ use example_common::{panic, *}; | |||
| 12 | use bxcan::filter::Mask32; | 12 | use bxcan::filter::Mask32; |
| 13 | use cortex_m_rt::entry; | 13 | use cortex_m_rt::entry; |
| 14 | use embassy::executor::{task, Executor}; | 14 | use embassy::executor::{task, Executor}; |
| 15 | use embassy::traits::gpio::*; | ||
| 16 | use embassy::util::Forever; | 15 | use embassy::util::Forever; |
| 17 | use embassy_stm32f4::{can, interrupt}; | 16 | use embassy_stm32f4::{can, interrupt}; |
| 18 | use futures::pin_mut; | ||
| 19 | use stm32f4xx_hal::prelude::*; | 17 | use stm32f4xx_hal::prelude::*; |
| 20 | use stm32f4xx_hal::{can::Can, stm32}; | 18 | use stm32f4xx_hal::{can::Can, stm32}; |
| 21 | 19 | ||
| @@ -35,7 +33,7 @@ async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { | |||
| 35 | 33 | ||
| 36 | let mut can = can::Can::new(can, interrupt::take!(CAN1_TX), interrupt::take!(CAN1_RX0)); | 34 | let mut can = can::Can::new(can, interrupt::take!(CAN1_TX), interrupt::take!(CAN1_RX0)); |
| 37 | 35 | ||
| 38 | let frame = can.receive().await; | 36 | let _frame = can.receive().await; |
| 39 | } | 37 | } |
| 40 | 38 | ||
| 41 | static EXECUTOR: Forever<Executor> = Forever::new(); | 39 | static EXECUTOR: Forever<Executor> = Forever::new(); |
diff --git a/embassy-stm32f4-examples/src/bin/serial.rs b/embassy-stm32f4-examples/src/bin/serial.rs index b138bfdd8..49a588c25 100644 --- a/embassy-stm32f4-examples/src/bin/serial.rs +++ b/embassy-stm32f4-examples/src/bin/serial.rs | |||
| @@ -43,7 +43,7 @@ async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) { | |||
| 43 | 43 | ||
| 44 | let streams = StreamsTuple::new(dp.DMA2); | 44 | let streams = StreamsTuple::new(dp.DMA2); |
| 45 | 45 | ||
| 46 | let mut serial = unsafe { | 46 | let _serial = unsafe { |
| 47 | serial::Serial::new( | 47 | serial::Serial::new( |
| 48 | dp.USART1, | 48 | dp.USART1, |
| 49 | (streams.7, streams.2), | 49 | (streams.7, streams.2), |
