aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32g4/src/bin/can.rs
diff options
context:
space:
mode:
authorCorey Schuhen <[email protected]>2024-03-02 09:00:54 +1000
committerCorey Schuhen <[email protected]>2024-03-02 09:09:27 +1000
commitdf8f508ffa2bec79f6e3fba4ac3cfe0e5545b5b2 (patch)
tree8d9724cde58d612778900982be9b69fddd567674 /examples/stm32g4/src/bin/can.rs
parentd5c9c611fa317e066d6cf7c5af0513b40bd69d8c (diff)
Writing to TX buffer also needs to fire an interrupt to kick off transmission if it is idle.
Formatting
Diffstat (limited to 'examples/stm32g4/src/bin/can.rs')
-rw-r--r--examples/stm32g4/src/bin/can.rs6
1 files changed, 5 insertions, 1 deletions
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) {
184 let frame = can::frame::ClassicFrame::new_extended(0x123456F, &[i; 8]).unwrap(); 184 let frame = can::frame::ClassicFrame::new_extended(0x123456F, &[i; 8]).unwrap();
185 info!("Writing frame"); 185 info!("Writing frame");
186 186
187 _ = can.write(frame).await; 187 // You can use any of these approaches to send. The writer makes it
188 // easy to share sending from multiple tasks.
189 //_ = can.write(frame).await;
190 //can.writer().try_write(frame).unwrap();
191 can.writer().write(frame).await;
188 192
189 match can.read().await { 193 match can.read().await {
190 Ok((rx_frame, ts)) => { 194 Ok((rx_frame, ts)) => {