Skip to content

Commit fe05fe7

Browse files
committed
test: continuous transfer is locking dma
1 parent 4b1d5ff commit fe05fe7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

hil-test/tests/embassy_interrupt_spi_dma.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,19 +62,19 @@ async fn interrupt_driven_task(i2s_tx: esp_hal::i2s::master::I2s<'static, Blocki
6262
use esp_hal::{dma::DmaTxStreamBuf, dma_buffers_chunk_size};
6363
let (_, _, tx_buffer, tx_descriptors) = dma_buffers_chunk_size!(128, 128, 128 / 3);
6464

65-
let i2s_tx = i2s_tx.into_async().i2s_tx.build();
66-
let mut transfer = i2s_tx
67-
.write(DmaTxStreamBuf::new(tx_descriptors, tx_buffer).unwrap())
68-
.unwrap();
65+
let mut i2s_tx = i2s_tx.into_async().i2s_tx.build();
66+
let mut buf = DmaTxStreamBuf::new(tx_descriptors, tx_buffer).unwrap();
6967

7068
loop {
7169
let mut buffer: [u8; 8] = [0; 8];
7270

7371
INTERRUPT_TASK_WORKING.store(true, portable_atomic::Ordering::Relaxed);
72+
let mut transfer = i2s_tx.write(buf).unwrap();
7473
while transfer.available_bytes() == 0 {
7574
transfer.wait_for_available().await.unwrap();
7675
}
7776
transfer.push(&mut buffer);
77+
(i2s_tx, buf) = transfer.stop();
7878
INTERRUPT_TASK_WORKING.store(false, portable_atomic::Ordering::Relaxed);
7979

8080
if STOP_INTERRUPT_TASK.load(portable_atomic::Ordering::Relaxed) {

0 commit comments

Comments
 (0)