stm32: can: fd: fix test build for all relevant chips

This commit is contained in:
Torin Cooper-Bennun 2024-04-19 15:09:01 +01:00
parent 263071d016
commit 543c02e649
2 changed files with 18 additions and 6 deletions

View File

@ -15,7 +15,7 @@ stm32f446re = ["embassy-stm32/stm32f446re", "chrono", "stop", "can", "not-gpdma"
stm32f767zi = ["embassy-stm32/stm32f767zi", "chrono", "not-gpdma", "eth", "rng"] stm32f767zi = ["embassy-stm32/stm32f767zi", "chrono", "not-gpdma", "eth", "rng"]
stm32g071rb = ["embassy-stm32/stm32g071rb", "cm0", "not-gpdma", "dac", "ucpd"] stm32g071rb = ["embassy-stm32/stm32g071rb", "cm0", "not-gpdma", "dac", "ucpd"]
stm32g491re = ["embassy-stm32/stm32g491re", "chrono", "stop", "not-gpdma", "rng", "fdcan", "cordic"] stm32g491re = ["embassy-stm32/stm32g491re", "chrono", "stop", "not-gpdma", "rng", "fdcan", "cordic"]
stm32h563zi = ["embassy-stm32/stm32h563zi", "chrono", "eth", "rng", "hash", "cordic"] stm32h563zi = ["embassy-stm32/stm32h563zi", "chrono", "eth", "rng", "fdcan", "hash", "cordic"]
stm32h753zi = ["embassy-stm32/stm32h753zi", "chrono", "not-gpdma", "eth", "rng", "fdcan", "hash", "cryp"] stm32h753zi = ["embassy-stm32/stm32h753zi", "chrono", "not-gpdma", "eth", "rng", "fdcan", "hash", "cryp"]
stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "chrono", "not-gpdma", "eth", "dac", "rng", "fdcan", "hash", "cryp"] stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "chrono", "not-gpdma", "eth", "dac", "rng", "fdcan", "hash", "cryp"]
stm32h7a3zi = ["embassy-stm32/stm32h7a3zi", "not-gpdma", "rng", "fdcan"] stm32h7a3zi = ["embassy-stm32/stm32h7a3zi", "not-gpdma", "rng", "fdcan"]

View File

@ -24,7 +24,19 @@ bind_interrupts!(struct Irqs1 {
FDCAN1_IT1 => can::IT1InterruptHandler<FDCAN1>; FDCAN1_IT1 => can::IT1InterruptHandler<FDCAN1>;
}); });
#[cfg(any(feature = "stm32h755zi", feature = "stm32h753zi", feature = "stm32h563zi"))] #[cfg(feature = "stm32h563zi")]
fn options() -> (Config, TestOptions) {
info!("H563 config");
(
config(),
TestOptions {
max_latency: Duration::from_micros(1200),
max_buffered: 3,
},
)
}
#[cfg(any(feature = "stm32h755zi", feature = "stm32h753zi"))]
fn options() -> (Config, TestOptions) { fn options() -> (Config, TestOptions) {
use embassy_stm32::rcc; use embassy_stm32::rcc;
info!("H75 config"); info!("H75 config");
@ -88,11 +100,11 @@ async fn main(_spawner: Spawner) {
can.set_bitrate(250_000); can.set_bitrate(250_000);
can2.set_bitrate(250_000); can2.set_bitrate(250_000);
can.set_extended_filter( can.properties().set_extended_filter(
can::filter::ExtendedFilterSlot::_0, can::filter::ExtendedFilterSlot::_0,
can::filter::ExtendedFilter::accept_all_into_fifo1(), can::filter::ExtendedFilter::accept_all_into_fifo1(),
); );
can2.set_extended_filter( can2.properties().set_extended_filter(
can::filter::ExtendedFilterSlot::_0, can::filter::ExtendedFilterSlot::_0,
can::filter::ExtendedFilter::accept_all_into_fifo1(), can::filter::ExtendedFilter::accept_all_into_fifo1(),
); );
@ -106,8 +118,8 @@ async fn main(_spawner: Spawner) {
info!("CAN Configured"); info!("CAN Configured");
// Test again with a split // Test again with a split
let (mut tx, mut rx) = can.split(); let (mut tx, mut rx, _props) = can.split();
let (mut tx2, mut rx2) = can2.split(); let (mut tx2, mut rx2, _props) = can2.split();
run_split_can_tests(&mut tx, &mut rx, &options).await; run_split_can_tests(&mut tx, &mut rx, &options).await;
run_split_can_tests(&mut tx2, &mut rx2, &options).await; run_split_can_tests(&mut tx2, &mut rx2, &options).await;