diff --git a/dma_gpio2/Cargo.toml b/dma_gpio2/Cargo.toml index 34556e8..b87b77d 100644 --- a/dma_gpio2/Cargo.toml +++ b/dma_gpio2/Cargo.toml @@ -16,7 +16,7 @@ embassy-sync = { path = "/home/filip/programs/embassy/embassy-sync" } embassy-time = { path = "/home/filip/programs/embassy/embassy-time", features = ["tick-hz-32_768"] } embassy-hal-internal = { path = "/home/filip/programs/embassy/embassy-hal-internal" } embassy-usb = { path = "/home/filip/programs/embassy/embassy-usb" } -embassy-stm32 = { path = "/home/filip/programs/embassy/embassy-stm32", features = ["unstable-pac", "stm32u575zi", "time-driver-tim2", "memory-x", "defmt", "dma_debug"] } +embassy-stm32 = { path = "/home/filip/programs/embassy/embassy-stm32", features = ["unstable-pac", "stm32u575zi", "time-driver-tim2", "memory-x", "defmt"] } embedded-hal = "1.0.0" embedded-graphics = "0.8.1" diff --git a/dma_gpio2/src/bin/main.rs b/dma_gpio2/src/bin/main.rs index 18afe86..3f35ee0 100644 --- a/dma_gpio2/src/bin/main.rs +++ b/dma_gpio2/src/bin/main.rs @@ -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");