Remove more BXCAN generics.
This commit is contained in:
committed by
Corey Schuhen
parent
e61136fa4a
commit
367a22cc0e
@@ -18,10 +18,6 @@ use {defmt_rtt as _, panic_probe as _};
|
||||
mod can_common;
|
||||
use can_common::*;
|
||||
|
||||
type Can<'d> = embassy_stm32::can::Can<'d, embassy_stm32::peripherals::CAN1>;
|
||||
type CanTx<'d> = embassy_stm32::can::CanTx<'d>;
|
||||
type CanRx<'d> = embassy_stm32::can::CanRx<'d>;
|
||||
|
||||
bind_interrupts!(struct Irqs {
|
||||
CAN1_RX0 => Rx0InterruptHandler<CAN1>;
|
||||
CAN1_RX1 => Rx1InterruptHandler<CAN1>;
|
||||
@@ -50,7 +46,7 @@ async fn main(_spawner: Spawner) {
|
||||
let rx_pin = Input::new(&mut rx, Pull::Up);
|
||||
core::mem::forget(rx_pin);
|
||||
|
||||
let mut can = Can::new(can, rx, tx, Irqs);
|
||||
let mut can = embassy_stm32::can::Can::new(can, rx, tx, Irqs);
|
||||
|
||||
info!("Configuring can...");
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@ pub struct TestOptions {
|
||||
pub max_buffered: u8,
|
||||
}
|
||||
|
||||
pub async fn run_can_tests<'d>(can: &mut crate::Can<'d>, options: &TestOptions) {
|
||||
pub async fn run_can_tests<'d>(can: &mut can::Can<'d>, options: &TestOptions) {
|
||||
//pub async fn run_can_tests<'d, T: can::Instance>(can: &mut can::Can<'d, T>, options: &TestOptions) {
|
||||
let mut i: u8 = 0;
|
||||
loop {
|
||||
@@ -80,7 +80,7 @@ pub async fn run_can_tests<'d>(can: &mut crate::Can<'d>, options: &TestOptions)
|
||||
}
|
||||
}
|
||||
|
||||
pub async fn run_split_can_tests<'d>(tx: &mut crate::CanTx<'d>, rx: &mut crate::CanRx<'d>, options: &TestOptions) {
|
||||
pub async fn run_split_can_tests<'d>(tx: &mut can::CanTx<'d>, rx: &mut can::CanRx<'d>, options: &TestOptions) {
|
||||
for i in 0..options.max_buffered {
|
||||
// Try filling up the RX FIFO0 buffers
|
||||
//let tx_frame = if 0 != (i & 0x01) {
|
||||
|
||||
@@ -15,10 +15,6 @@ use {defmt_rtt as _, panic_probe as _};
|
||||
mod can_common;
|
||||
use can_common::*;
|
||||
|
||||
type Can<'d> = can::Can<'d>;
|
||||
type CanTx<'d> = can::CanTx<'d>;
|
||||
type CanRx<'d> = can::CanRx<'d>;
|
||||
|
||||
bind_interrupts!(struct Irqs2 {
|
||||
FDCAN2_IT0 => can::IT0InterruptHandler<FDCAN2>;
|
||||
FDCAN2_IT1 => can::IT1InterruptHandler<FDCAN2>;
|
||||
|
||||
Reference in New Issue
Block a user