diff options
| author | Torin Cooper-Bennun <[email protected]> | 2024-04-19 15:09:01 +0100 |
|---|---|---|
| committer | Torin Cooper-Bennun <[email protected]> | 2024-04-22 13:30:57 +0100 |
| commit | 543c02e649ea8ec05597daca3816c05db2c6ab53 (patch) | |
| tree | 42b4027d1b321544e3d20c78b5f4f56ec6625160 /tests | |
| parent | 263071d0169318ab24e0f6caac87a13d1c906769 (diff) | |
stm32: can: fd: fix test build for all relevant chips
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/Cargo.toml | 2 | ||||
| -rw-r--r-- | tests/stm32/src/bin/fdcan.rs | 22 |
2 files changed, 18 insertions, 6 deletions
diff --git a/tests/stm32/Cargo.toml b/tests/stm32/Cargo.toml index e09083111..004846a9b 100644 --- a/tests/stm32/Cargo.toml +++ b/tests/stm32/Cargo.toml | |||
| @@ -15,7 +15,7 @@ stm32f446re = ["embassy-stm32/stm32f446re", "chrono", "stop", "can", "not-gpdma" | |||
| 15 | stm32f767zi = ["embassy-stm32/stm32f767zi", "chrono", "not-gpdma", "eth", "rng"] | 15 | stm32f767zi = ["embassy-stm32/stm32f767zi", "chrono", "not-gpdma", "eth", "rng"] |
| 16 | stm32g071rb = ["embassy-stm32/stm32g071rb", "cm0", "not-gpdma", "dac", "ucpd"] | 16 | stm32g071rb = ["embassy-stm32/stm32g071rb", "cm0", "not-gpdma", "dac", "ucpd"] |
| 17 | stm32g491re = ["embassy-stm32/stm32g491re", "chrono", "stop", "not-gpdma", "rng", "fdcan", "cordic"] | 17 | stm32g491re = ["embassy-stm32/stm32g491re", "chrono", "stop", "not-gpdma", "rng", "fdcan", "cordic"] |
| 18 | stm32h563zi = ["embassy-stm32/stm32h563zi", "chrono", "eth", "rng", "hash", "cordic"] | 18 | stm32h563zi = ["embassy-stm32/stm32h563zi", "chrono", "eth", "rng", "fdcan", "hash", "cordic"] |
| 19 | stm32h753zi = ["embassy-stm32/stm32h753zi", "chrono", "not-gpdma", "eth", "rng", "fdcan", "hash", "cryp"] | 19 | stm32h753zi = ["embassy-stm32/stm32h753zi", "chrono", "not-gpdma", "eth", "rng", "fdcan", "hash", "cryp"] |
| 20 | stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "chrono", "not-gpdma", "eth", "dac", "rng", "fdcan", "hash", "cryp"] | 20 | stm32h755zi = ["embassy-stm32/stm32h755zi-cm7", "chrono", "not-gpdma", "eth", "dac", "rng", "fdcan", "hash", "cryp"] |
| 21 | stm32h7a3zi = ["embassy-stm32/stm32h7a3zi", "not-gpdma", "rng", "fdcan"] | 21 | stm32h7a3zi = ["embassy-stm32/stm32h7a3zi", "not-gpdma", "rng", "fdcan"] |
diff --git a/tests/stm32/src/bin/fdcan.rs b/tests/stm32/src/bin/fdcan.rs index 27bdd038a..b0c0cd82e 100644 --- a/tests/stm32/src/bin/fdcan.rs +++ b/tests/stm32/src/bin/fdcan.rs | |||
| @@ -24,7 +24,19 @@ bind_interrupts!(struct Irqs1 { | |||
| 24 | FDCAN1_IT1 => can::IT1InterruptHandler<FDCAN1>; | 24 | FDCAN1_IT1 => can::IT1InterruptHandler<FDCAN1>; |
| 25 | }); | 25 | }); |
| 26 | 26 | ||
| 27 | #[cfg(any(feature = "stm32h755zi", feature = "stm32h753zi", feature = "stm32h563zi"))] | 27 | #[cfg(feature = "stm32h563zi")] |
| 28 | fn options() -> (Config, TestOptions) { | ||
| 29 | info!("H563 config"); | ||
| 30 | ( | ||
| 31 | config(), | ||
| 32 | TestOptions { | ||
| 33 | max_latency: Duration::from_micros(1200), | ||
| 34 | max_buffered: 3, | ||
| 35 | }, | ||
| 36 | ) | ||
| 37 | } | ||
| 38 | |||
| 39 | #[cfg(any(feature = "stm32h755zi", feature = "stm32h753zi"))] | ||
| 28 | fn options() -> (Config, TestOptions) { | 40 | fn options() -> (Config, TestOptions) { |
| 29 | use embassy_stm32::rcc; | 41 | use embassy_stm32::rcc; |
| 30 | info!("H75 config"); | 42 | info!("H75 config"); |
| @@ -88,11 +100,11 @@ async fn main(_spawner: Spawner) { | |||
| 88 | can.set_bitrate(250_000); | 100 | can.set_bitrate(250_000); |
| 89 | can2.set_bitrate(250_000); | 101 | can2.set_bitrate(250_000); |
| 90 | 102 | ||
| 91 | can.set_extended_filter( | 103 | can.properties().set_extended_filter( |
| 92 | can::filter::ExtendedFilterSlot::_0, | 104 | can::filter::ExtendedFilterSlot::_0, |
| 93 | can::filter::ExtendedFilter::accept_all_into_fifo1(), | 105 | can::filter::ExtendedFilter::accept_all_into_fifo1(), |
| 94 | ); | 106 | ); |
| 95 | can2.set_extended_filter( | 107 | can2.properties().set_extended_filter( |
| 96 | can::filter::ExtendedFilterSlot::_0, | 108 | can::filter::ExtendedFilterSlot::_0, |
| 97 | can::filter::ExtendedFilter::accept_all_into_fifo1(), | 109 | can::filter::ExtendedFilter::accept_all_into_fifo1(), |
| 98 | ); | 110 | ); |
| @@ -106,8 +118,8 @@ async fn main(_spawner: Spawner) { | |||
| 106 | info!("CAN Configured"); | 118 | info!("CAN Configured"); |
| 107 | 119 | ||
| 108 | // Test again with a split | 120 | // Test again with a split |
| 109 | let (mut tx, mut rx) = can.split(); | 121 | let (mut tx, mut rx, _props) = can.split(); |
| 110 | let (mut tx2, mut rx2) = can2.split(); | 122 | let (mut tx2, mut rx2, _props) = can2.split(); |
| 111 | run_split_can_tests(&mut tx, &mut rx, &options).await; | 123 | run_split_can_tests(&mut tx, &mut rx, &options).await; |
| 112 | run_split_can_tests(&mut tx2, &mut rx2, &options).await; | 124 | run_split_can_tests(&mut tx2, &mut rx2, &options).await; |
| 113 | 125 | ||
