diff --git a/esp-hal/MIGRATING-0.20.md b/esp-hal/MIGRATING-0.20.md index 21329cf2c45..c1907594fd7 100644 --- a/esp-hal/MIGRATING-0.20.md +++ b/esp-hal/MIGRATING-0.20.md @@ -85,8 +85,8 @@ To avoid confusion with the `Rtc::current_time` wall clock time APIs, we've rena ## RX/TX Order -Previously, our API was pretty inconsitent with the RX/TX ordering, and different peripherals had different order. Now, all -the peripherals use rx-tx. Make sure your methods are expecting the rigth RX/TX order, for example an SPI DMA app should be updated to: +Previously, our API was pretty inconsistent with the RX/TX ordering, and different peripherals had different order. Now, all +the peripherals use rx-tx. Make sure your methods are expecting the right RX/TX order, for example an SPI DMA app should be updated to: ```diff - let (tx_buffer, tx_descriptors, rx_buffer, rx_descriptors) = dma_buffers!(4); @@ -103,6 +103,13 @@ let dma_rx_buf = DmaRxBuf::new(rx_descriptors, rx_buffer).unwrap(); .unwrap(); ``` +When using the asymmetric variant of the macro to create DMA buffers and descriptors make sure to swap the order of parameters + +```diff +- let (tx_buffer, tx_descriptors, _, _) = dma_buffers!(32000, 0); ++ let (_, _, tx_buffer, tx_descriptors) = dma_buffers!(0, 32000); +``` + ## Removed UART constructors The `Uart::new_with_default_pins` and `Uart::new_async_with_default_pins` constructors diff --git a/examples/src/bin/embassy_i2s_read.rs b/examples/src/bin/embassy_i2s_read.rs index 7a644cf5c5d..8c1949a7571 100644 --- a/examples/src/bin/embassy_i2s_read.rs +++ b/examples/src/bin/embassy_i2s_read.rs @@ -45,7 +45,7 @@ async fn main(_spawner: Spawner) { #[cfg(not(any(feature = "esp32", feature = "esp32s2")))] let dma_channel = dma.channel0; - let (rx_buffer, rx_descriptors, _, tx_descriptors) = dma_buffers!(0, 4092 * 4); + let (rx_buffer, rx_descriptors, _, tx_descriptors) = dma_buffers!(4092 * 4, 0); let i2s = I2s::new( peripherals.I2S0, diff --git a/examples/src/bin/embassy_i2s_sound.rs b/examples/src/bin/embassy_i2s_sound.rs index 1425a4a431e..cbea6965f35 100644 --- a/examples/src/bin/embassy_i2s_sound.rs +++ b/examples/src/bin/embassy_i2s_sound.rs @@ -67,7 +67,7 @@ async fn main(_spawner: Spawner) { #[cfg(not(any(feature = "esp32", feature = "esp32s2")))] let dma_channel = dma.channel0; - let (_, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(32000, 0); + let (_, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(0, 32000); let i2s = I2s::new( peripherals.I2S0, diff --git a/examples/src/bin/embassy_parl_io_rx.rs b/examples/src/bin/embassy_parl_io_rx.rs index 687502baeb3..83fccaec51d 100644 --- a/examples/src/bin/embassy_parl_io_rx.rs +++ b/examples/src/bin/embassy_parl_io_rx.rs @@ -33,7 +33,7 @@ async fn main(_spawner: Spawner) { let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); - let (rx_buffer, rx_descriptors, _, _) = dma_buffers!(0, 32000); + let (rx_buffer, rx_descriptors, _, _) = dma_buffers!(32000, 0); let dma = Dma::new(peripherals.DMA); let dma_channel = dma.channel0; diff --git a/examples/src/bin/embassy_parl_io_tx.rs b/examples/src/bin/embassy_parl_io_tx.rs index 7b16470ba88..9a1ca372fb3 100644 --- a/examples/src/bin/embassy_parl_io_tx.rs +++ b/examples/src/bin/embassy_parl_io_tx.rs @@ -44,7 +44,7 @@ async fn main(_spawner: Spawner) { let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); - let (_, _, tx_buffer, tx_descriptors) = dma_buffers!(32000, 0); + let (_, _, tx_buffer, tx_descriptors) = dma_buffers!(0, 32000); let dma = Dma::new(peripherals.DMA); let dma_channel = dma.channel0; diff --git a/examples/src/bin/i2s_read.rs b/examples/src/bin/i2s_read.rs index ecfa922186c..0ad0f0619e1 100644 --- a/examples/src/bin/i2s_read.rs +++ b/examples/src/bin/i2s_read.rs @@ -38,7 +38,7 @@ fn main() -> ! { #[cfg(not(any(feature = "esp32", feature = "esp32s2")))] let dma_channel = dma.channel0; - let (mut rx_buffer, rx_descriptors, _, tx_descriptors) = dma_buffers!(0, 4 * 4092); + let (mut rx_buffer, rx_descriptors, _, tx_descriptors) = dma_buffers!(4 * 4092, 0); // Here we test that the type is // 1) reasonably simple (or at least this will flag changes that may make it diff --git a/examples/src/bin/i2s_sound.rs b/examples/src/bin/i2s_sound.rs index ec06e6b627a..060bbdc63cf 100644 --- a/examples/src/bin/i2s_sound.rs +++ b/examples/src/bin/i2s_sound.rs @@ -59,7 +59,7 @@ fn main() -> ! { #[cfg(not(any(feature = "esp32", feature = "esp32s2")))] let dma_channel = dma.channel0; - let (_, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(32000, 0); + let (_, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(0, 32000); let i2s = I2s::new( peripherals.I2S0, diff --git a/examples/src/bin/lcd_cam_ov2640.rs b/examples/src/bin/lcd_cam_ov2640.rs index 916bc716529..8afa95eef01 100644 --- a/examples/src/bin/lcd_cam_ov2640.rs +++ b/examples/src/bin/lcd_cam_ov2640.rs @@ -49,7 +49,7 @@ fn main() -> ! { let dma = Dma::new(peripherals.DMA); let channel = dma.channel0; - let (rx_buffer, rx_descriptors, _, _) = dma_buffers!(0, 32678); + let (rx_buffer, rx_descriptors, _, _) = dma_buffers!(32678, 0); let channel = channel.configure(false, DmaPriority::Priority0); diff --git a/examples/src/bin/lcd_i8080.rs b/examples/src/bin/lcd_i8080.rs index e41436bf37d..e4cb0a6475c 100644 --- a/examples/src/bin/lcd_i8080.rs +++ b/examples/src/bin/lcd_i8080.rs @@ -50,7 +50,7 @@ fn main() -> ! { let dma = Dma::new(peripherals.DMA); let channel = dma.channel0; - let (_, _, tx_buffer, tx_descriptors) = dma_buffers!(32678, 0); + let (_, _, tx_buffer, tx_descriptors) = dma_buffers!(0, 32678); let channel = channel.configure(false, DmaPriority::Priority0); diff --git a/examples/src/bin/parl_io_rx.rs b/examples/src/bin/parl_io_rx.rs index 5ea1b8ae73e..8f66c376ea4 100644 --- a/examples/src/bin/parl_io_rx.rs +++ b/examples/src/bin/parl_io_rx.rs @@ -26,7 +26,7 @@ fn main() -> ! { let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); - let (rx_buffer, rx_descriptors, _, _) = dma_buffers!(0, 32000); + let (rx_buffer, rx_descriptors, _, _) = dma_buffers!(32000, 0); let dma = Dma::new(peripherals.DMA); let dma_channel = dma.channel0; diff --git a/examples/src/bin/parl_io_tx.rs b/examples/src/bin/parl_io_tx.rs index ed5b3a45e03..0df17ad398e 100644 --- a/examples/src/bin/parl_io_tx.rs +++ b/examples/src/bin/parl_io_tx.rs @@ -37,7 +37,7 @@ fn main() -> ! { let io = Io::new(peripherals.GPIO, peripherals.IO_MUX); - let (_, _, tx_buffer, tx_descriptors) = dma_buffers!(32000, 0); + let (_, _, tx_buffer, tx_descriptors) = dma_buffers!(0, 32000); let dma = Dma::new(peripherals.DMA); let dma_channel = dma.channel0; diff --git a/examples/src/bin/qspi_flash.rs b/examples/src/bin/qspi_flash.rs index 005819e2881..f68074bdf82 100644 --- a/examples/src/bin/qspi_flash.rs +++ b/examples/src/bin/qspi_flash.rs @@ -75,7 +75,7 @@ fn main() -> ! { } } - let (rx_buffer, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(256, 320); + let (rx_buffer, rx_descriptors, tx_buffer, tx_descriptors) = dma_buffers!(320, 256); let mut dma_rx_buf = DmaRxBuf::new(rx_descriptors, rx_buffer).unwrap(); let mut dma_tx_buf = DmaTxBuf::new(tx_descriptors, tx_buffer).unwrap();