This commit is contained in:
Mick van Gelderen 2023-11-21 15:40:07 +01:00
parent 19ba7da3fd
commit 88f893da45
No known key found for this signature in database
GPG Key ID: 6BD3FEFAFF7626D1

View File

@ -179,10 +179,7 @@ impl<'d, T: Instance> Can<'d, T> {
pub fn set_bitrate(&mut self, bitrate: u32) { pub fn set_bitrate(&mut self, bitrate: u32) {
let bit_timing = Self::calc_bxcan_timings(T::frequency(), bitrate).unwrap(); let bit_timing = Self::calc_bxcan_timings(T::frequency(), bitrate).unwrap();
self.can self.can.modify_config().set_bit_timing(bit_timing).leave_disabled();
.modify_config()
.set_bit_timing(bit_timing)
.leave_disabled();
} }
/// Enables the peripheral and synchronizes with the bus. /// Enables the peripheral and synchronizes with the bus.
@ -197,7 +194,6 @@ impl<'d, T: Instance> Can<'d, T> {
} }
} }
/// Queues the message to be sent but exerts backpressure /// Queues the message to be sent but exerts backpressure
pub async fn write(&mut self, frame: &Frame) -> bxcan::TransmitStatus { pub async fn write(&mut self, frame: &Frame) -> bxcan::TransmitStatus {
self.split().0.write(frame).await self.split().0.write(frame).await
@ -473,8 +469,6 @@ impl<'c, 'd, T: Instance> CanTx<'c, 'd, T> {
.await; .await;
} }
/// Waits until all of the transmit mailboxes become empty /// Waits until all of the transmit mailboxes become empty
pub async fn flush_all(&self) { pub async fn flush_all(&self) {
Self::flush_all_inner().await Self::flush_all_inner().await