Skip to content

Commit

Permalink
feat: Update rx-tx order in embassy_interrupt_spi_dma tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SergioGasquez committed Sep 4, 2024
1 parent 603d534 commit e64e463
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions hil-test/tests/embassy_interrupt_spi_dma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,11 @@ macro_rules! mk_static {
async fn interrupt_driven_task(spi: SpiDma<'static, SPI3, DmaChannel1, FullDuplexMode, Async>) {
let mut ticker = Ticker::every(Duration::from_millis(1));

let (tx_buffer, tx_descriptors, rx_buffer, rx_descriptors) = dma_buffers!(128);
let dma_tx_buf = DmaTxBuf::new(tx_descriptors, tx_buffer).unwrap();
let (rx_buffer, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(128);
let dma_rx_buf = DmaRxBuf::new(rx_descriptors, rx_buffer).unwrap();
let dma_tx_buf = DmaTxBuf::new(tx_descriptors, tx_buffer).unwrap();

let mut spi = spi.with_buffers(dma_tx_buf, dma_rx_buf);
let mut spi = spi.with_buffers(dma_rx_buf, dma_tx_buf);

loop {
let mut buffer: [u8; 8] = [0; 8];
Expand Down Expand Up @@ -95,13 +95,13 @@ mod test {
}
}

let (tx_buffer, tx_descriptors, rx_buffer, rx_descriptors) = dma_buffers!(1024);
let dma_tx_buf = DmaTxBuf::new(tx_descriptors, tx_buffer).unwrap();
let (rx_buffer, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(1024);
let dma_rx_buf = DmaRxBuf::new(rx_descriptors, rx_buffer).unwrap();
let dma_tx_buf = DmaTxBuf::new(tx_descriptors, tx_buffer).unwrap();

let mut spi = Spi::new(peripherals.SPI2, 100.kHz(), SpiMode::Mode0, &clocks)
.with_dma(dma_channel1.configure_for_async(false, DmaPriority::Priority0))
.with_buffers(dma_tx_buf, dma_rx_buf);
.with_buffers(dma_rx_buf, dma_tx_buf);

let spi2 = Spi::new(peripherals.SPI3, 100.kHz(), SpiMode::Mode0, &clocks)
.with_dma(dma_channel2.configure_for_async(false, DmaPriority::Priority0));
Expand Down

0 comments on commit e64e463

Please sign in to comment.