diff options
| author | Dario Nieuwenhuis <[email protected]> | 2024-06-02 10:33:14 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2024-06-02 10:33:14 +0000 |
| commit | 5f8f867eae57ca313157f2df60d9c0b5355907ce (patch) | |
| tree | eca4ce4518eb7b1ec62dc2286f03e3a6ca2f6fab /tests | |
| parent | e61136fa4ab0261ec9d9e262e1c3295d4549fa5f (diff) | |
| parent | 58ef2594e511bd5147aae504b8ff723152ab1d1b (diff) | |
Merge pull request #3032 from cschuhen/feature/bxcan_no_generics2
Remove more BXCAN generics.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/stm32/src/bin/can.rs | 6 | ||||
| -rw-r--r-- | tests/stm32/src/bin/can_common.rs | 4 | ||||
| -rw-r--r-- | tests/stm32/src/bin/fdcan.rs | 4 |
3 files changed, 3 insertions, 11 deletions
diff --git a/tests/stm32/src/bin/can.rs b/tests/stm32/src/bin/can.rs index f63076512..ba8a33e34 100644 --- a/tests/stm32/src/bin/can.rs +++ b/tests/stm32/src/bin/can.rs | |||
| @@ -18,10 +18,6 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 18 | mod can_common; | 18 | mod can_common; |
| 19 | use can_common::*; | 19 | use can_common::*; |
| 20 | 20 | ||
| 21 | type Can<'d> = embassy_stm32::can::Can<'d, embassy_stm32::peripherals::CAN1>; | ||
| 22 | type CanTx<'d> = embassy_stm32::can::CanTx<'d>; | ||
| 23 | type CanRx<'d> = embassy_stm32::can::CanRx<'d>; | ||
| 24 | |||
| 25 | bind_interrupts!(struct Irqs { | 21 | bind_interrupts!(struct Irqs { |
| 26 | CAN1_RX0 => Rx0InterruptHandler<CAN1>; | 22 | CAN1_RX0 => Rx0InterruptHandler<CAN1>; |
| 27 | CAN1_RX1 => Rx1InterruptHandler<CAN1>; | 23 | CAN1_RX1 => Rx1InterruptHandler<CAN1>; |
| @@ -50,7 +46,7 @@ async fn main(_spawner: Spawner) { | |||
| 50 | let rx_pin = Input::new(&mut rx, Pull::Up); | 46 | let rx_pin = Input::new(&mut rx, Pull::Up); |
| 51 | core::mem::forget(rx_pin); | 47 | core::mem::forget(rx_pin); |
| 52 | 48 | ||
| 53 | let mut can = Can::new(can, rx, tx, Irqs); | 49 | let mut can = embassy_stm32::can::Can::new(can, rx, tx, Irqs); |
| 54 | 50 | ||
| 55 | info!("Configuring can..."); | 51 | info!("Configuring can..."); |
| 56 | 52 | ||
diff --git a/tests/stm32/src/bin/can_common.rs b/tests/stm32/src/bin/can_common.rs index fbfbcdc21..4e1740ad5 100644 --- a/tests/stm32/src/bin/can_common.rs +++ b/tests/stm32/src/bin/can_common.rs | |||
| @@ -8,7 +8,7 @@ pub struct TestOptions { | |||
| 8 | pub max_buffered: u8, | 8 | pub max_buffered: u8, |
| 9 | } | 9 | } |
| 10 | 10 | ||
| 11 | pub async fn run_can_tests<'d>(can: &mut crate::Can<'d>, options: &TestOptions) { | 11 | pub async fn run_can_tests<'d>(can: &mut can::Can<'d>, options: &TestOptions) { |
| 12 | //pub async fn run_can_tests<'d, T: can::Instance>(can: &mut can::Can<'d, T>, options: &TestOptions) { | 12 | //pub async fn run_can_tests<'d, T: can::Instance>(can: &mut can::Can<'d, T>, options: &TestOptions) { |
| 13 | let mut i: u8 = 0; | 13 | let mut i: u8 = 0; |
| 14 | loop { | 14 | loop { |
| @@ -80,7 +80,7 @@ pub async fn run_can_tests<'d>(can: &mut crate::Can<'d>, options: &TestOptions) | |||
| 80 | } | 80 | } |
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | pub async fn run_split_can_tests<'d>(tx: &mut crate::CanTx<'d>, rx: &mut crate::CanRx<'d>, options: &TestOptions) { | 83 | pub async fn run_split_can_tests<'d>(tx: &mut can::CanTx<'d>, rx: &mut can::CanRx<'d>, options: &TestOptions) { |
| 84 | for i in 0..options.max_buffered { | 84 | for i in 0..options.max_buffered { |
| 85 | // Try filling up the RX FIFO0 buffers | 85 | // Try filling up the RX FIFO0 buffers |
| 86 | //let tx_frame = if 0 != (i & 0x01) { | 86 | //let tx_frame = if 0 != (i & 0x01) { |
diff --git a/tests/stm32/src/bin/fdcan.rs b/tests/stm32/src/bin/fdcan.rs index 8a397f661..bc2b7edd4 100644 --- a/tests/stm32/src/bin/fdcan.rs +++ b/tests/stm32/src/bin/fdcan.rs | |||
| @@ -15,10 +15,6 @@ use {defmt_rtt as _, panic_probe as _}; | |||
| 15 | mod can_common; | 15 | mod can_common; |
| 16 | use can_common::*; | 16 | use can_common::*; |
| 17 | 17 | ||
| 18 | type Can<'d> = can::Can<'d>; | ||
| 19 | type CanTx<'d> = can::CanTx<'d>; | ||
| 20 | type CanRx<'d> = can::CanRx<'d>; | ||
| 21 | |||
| 22 | bind_interrupts!(struct Irqs2 { | 18 | bind_interrupts!(struct Irqs2 { |
| 23 | FDCAN2_IT0 => can::IT0InterruptHandler<FDCAN2>; | 19 | FDCAN2_IT0 => can::IT0InterruptHandler<FDCAN2>; |
| 24 | FDCAN2_IT1 => can::IT1InterruptHandler<FDCAN2>; | 20 | FDCAN2_IT1 => can::IT1InterruptHandler<FDCAN2>; |
