working with the dma library

This commit is contained in:
Priec
2025-11-09 21:24:58 +01:00
parent ef98b7e4e9
commit fa6b217bc4
2 changed files with 3 additions and 12 deletions

View File

@@ -3,7 +3,6 @@
#![no_main]
use defmt::*;
use embassy_stm32::dma::ringbuffer::Error;
use embassy_executor::Spawner;
use embassy_futures::yield_now;
use embassy_stm32::dma::Request;
@@ -114,12 +113,12 @@ async fn main(_spawner: Spawner) {
loop {
info!("tick start");
//Timer::after(Duration::from_millis(400)).await;
Timer::after(Duration::from_millis(1021)).await;
//info!("tick end");
let used = encode_uart_frames(
TX_PIN_BIT,
b"Hihihi\r\n",
b"H\r\n",
&mut frame_buf,
)
.await;
@@ -158,14 +157,6 @@ async fn main(_spawner: Spawner) {
tx_ring.capacity()
);
}
Err(Error::Overrun) => {
warn!("XYZ");
// DMA lapped you. Must resync:
tx_ring.request_reset(); // Stop DMA
tx_ring.clear(); // Clear buffer
tx_ring.start(); // Restart
// Retry writing frame
}
}
info!("tick end");