From a9ff38003bebbb87aea2405437155d5312326803 Mon Sep 17 00:00:00 2001 From: Corey Schuhen Date: Tue, 5 Mar 2024 20:27:52 +1000 Subject: [PATCH] Documentation. . --- embassy-stm32/src/can/bx/filter.rs | 4 ++++ embassy-stm32/src/can/bx/mod.rs | 4 +++- examples/stm32f1/src/bin/can.rs | 6 +++--- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/embassy-stm32/src/can/bx/filter.rs b/embassy-stm32/src/can/bx/filter.rs index 64f020fc7..51766aa31 100644 --- a/embassy-stm32/src/can/bx/filter.rs +++ b/embassy-stm32/src/can/bx/filter.rs @@ -171,9 +171,13 @@ impl Mask32 { #[derive(Debug, Copy, Clone)] #[cfg_attr(feature = "defmt", derive(defmt::Format))] pub enum BankConfig { + /// Specify up to 4 exact standard CAN ID's. List16([ListEntry16; 4]), + /// Specify up to 2 exact standard or extended CAN ID's. List32([ListEntry32; 2]), + /// Specify up to 2 standard ID's with masks. Mask16([Mask16; 2]), + /// Specify a single extended ID with mask. Mask32(Mask32), } diff --git a/embassy-stm32/src/can/bx/mod.rs b/embassy-stm32/src/can/bx/mod.rs index eee8a33a6..375bc27f7 100644 --- a/embassy-stm32/src/can/bx/mod.rs +++ b/embassy-stm32/src/can/bx/mod.rs @@ -621,7 +621,7 @@ where unsafe { Rx1::conjure(self.canregs) } } - pub fn split_by_ref(&mut self) -> (Tx, Rx0, Rx1) { + pub(crate) fn split_by_ref(&mut self) -> (Tx, Rx0, Rx1) { // Safety: We take `&mut self` and the return value lifetimes are tied to `self`'s lifetime. let tx = unsafe { Tx::conjure(self.canregs) }; let rx0 = unsafe { Rx0::conjure(self.canregs) }; @@ -924,7 +924,9 @@ fn receive_fifo(canregs: crate::pac::can::Can, fifo_nr: usize) -> nb::Result match env.frame.id() { Id::Extended(id) => { - defmt::println!("Extended Frame id={:x}", id.as_raw()); + defmt::println!("Extended Frame id={:x} {:02x}", id.as_raw(), env.frame.data().unwrap()); } Id::Standard(id) => { - defmt::println!("Standard Frame id={:x}", id.as_raw()); + defmt::println!("Standard Frame id={:x} {:02x}", id.as_raw(), env.frame.data().unwrap()); } }, Err(err) => {