F4: Fix compilation for other MCUs

This commit is contained in:
Thales Fragoso
2021-03-18 22:23:09 -03:00
parent 456e04c79f
commit 88a25b042a
9 changed files with 80 additions and 19 deletions

View File

@ -15,11 +15,29 @@ defmt-info = []
defmt-warn = []
defmt-error = []
stm32f401 = ["stm32f4xx-hal/stm32f401", "embassy-stm32f4/stm32f401"]
stm32f405 = ["stm32f4xx-hal/stm32f405", "embassy-stm32f4/stm32f405"]
stm32f407 = ["stm32f4xx-hal/stm32f407", "embassy-stm32f4/stm32f407"]
stm32f410 = ["stm32f4xx-hal/stm32f410", "embassy-stm32f4/stm32f410"]
stm32f411 = ["stm32f4xx-hal/stm32f411", "embassy-stm32f4/stm32f411"]
stm32f412 = ["stm32f4xx-hal/stm32f412", "embassy-stm32f4/stm32f412"]
stm32f413 = ["stm32f4xx-hal/stm32f413", "embassy-stm32f4/stm32f413"]
stm32f415 = ["stm32f4xx-hal/stm32f405", "embassy-stm32f4/stm32f405"]
stm32f417 = ["stm32f4xx-hal/stm32f407", "embassy-stm32f4/stm32f407"]
stm32f423 = ["stm32f4xx-hal/stm32f413", "embassy-stm32f4/stm32f413"]
stm32f427 = ["stm32f4xx-hal/stm32f427", "embassy-stm32f4/stm32f427"]
stm32f429 = ["stm32f4xx-hal/stm32f429", "embassy-stm32f4/stm32f429"]
stm32f437 = ["stm32f4xx-hal/stm32f427", "embassy-stm32f4/stm32f427"]
stm32f439 = ["stm32f4xx-hal/stm32f429", "embassy-stm32f4/stm32f429"]
stm32f446 = ["stm32f4xx-hal/stm32f446", "embassy-stm32f4/stm32f446"]
stm32f469 = ["stm32f4xx-hal/stm32f469", "embassy-stm32f4/stm32f469"]
stm32f479 = ["stm32f4xx-hal/stm32f469", "embassy-stm32f4/stm32f469"]
[dependencies]
embassy = { version = "0.1.0", path = "../embassy", features = ["defmt", "defmt-trace"] }
embassy-traits = { version = "0.1.0", path = "../embassy-traits", features = ["defmt"] }
embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4", features = ["stm32f405"] }
embassy-stm32f4 = { version = "*", path = "../embassy-stm32f4" }
defmt = "0.2.0"
defmt-rtt = "0.2.0"
@ -28,7 +46,7 @@ cortex-m = "0.7.1"
cortex-m-rt = "0.6.13"
embedded-hal = { version = "0.2.4" }
panic-probe = "0.1.0"
stm32f4xx-hal = { version = "0.8.3", features = ["rt", "stm32f405"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git"}
stm32f4xx-hal = { version = "0.8.3", features = ["rt"], git = "https://github.com/stm32-rs/stm32f4xx-hal.git"}
futures = { version = "0.3.8", default-features = false, features = ["async-await"] }
rtt-target = { version = "0.3", features = ["cortex-m"] }
bxcan = "0.5.0"

View File

@ -12,10 +12,8 @@ use example_common::{panic, *};
use bxcan::filter::Mask32;
use cortex_m_rt::entry;
use embassy::executor::{task, Executor};
use embassy::traits::gpio::*;
use embassy::util::Forever;
use embassy_stm32f4::{can, interrupt};
use futures::pin_mut;
use stm32f4xx_hal::prelude::*;
use stm32f4xx_hal::{can::Can, stm32};
@ -35,7 +33,7 @@ async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
let mut can = can::Can::new(can, interrupt::take!(CAN1_TX), interrupt::take!(CAN1_RX0));
let frame = can.receive().await;
let _frame = can.receive().await;
}
static EXECUTOR: Forever<Executor> = Forever::new();

View File

@ -43,7 +43,7 @@ async fn run(dp: stm32::Peripherals, _cp: cortex_m::Peripherals) {
let streams = StreamsTuple::new(dp.DMA2);
let mut serial = unsafe {
let _serial = unsafe {
serial::Serial::new(
dp.USART1,
(streams.7, streams.2),