From df8f508ffa2bec79f6e3fba4ac3cfe0e5545b5b2 Mon Sep 17 00:00:00 2001 From: Corey Schuhen Date: Sat, 2 Mar 2024 09:00:54 +1000 Subject: Writing to TX buffer also needs to fire an interrupt to kick off transmission if it is idle. Formatting --- examples/stm32g4/src/bin/can.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples') diff --git a/examples/stm32g4/src/bin/can.rs b/examples/stm32g4/src/bin/can.rs index a41f765c1..11e96361e 100644 --- a/examples/stm32g4/src/bin/can.rs +++ b/examples/stm32g4/src/bin/can.rs @@ -184,7 +184,11 @@ async fn main(_spawner: Spawner) { let frame = can::frame::ClassicFrame::new_extended(0x123456F, &[i; 8]).unwrap(); info!("Writing frame"); - _ = can.write(frame).await; + // You can use any of these approaches to send. The writer makes it + // easy to share sending from multiple tasks. + //_ = can.write(frame).await; + //can.writer().try_write(frame).unwrap(); + can.writer().write(frame).await; match can.read().await { Ok((rx_frame, ts)) => { -- cgit