From 19c9cef9a85c3e496a966cd7d7b9fccf5f43a266 Mon Sep 17 00:00:00 2001 From: Scott Mabin Date: Tue, 12 Dec 2023 17:55:37 +0000 Subject: [PATCH] auto enable interrupts (#1014) * auto enable interrupts * changelog * cfgs --- CHANGELOG.md | 1 + esp-hal-common/Cargo.toml | 4 +- esp-hal-common/src/embassy/mod.rs | 64 +++++++++++++++++++ esp32-hal/examples/embassy_i2c.rs | 2 - esp32-hal/examples/embassy_i2s_read.rs | 7 -- esp32-hal/examples/embassy_i2s_sound.rs | 7 -- esp32-hal/examples/embassy_rmt_rx.rs | 7 -- esp32-hal/examples/embassy_rmt_tx.rs | 7 -- esp32-hal/examples/embassy_serial.rs | 2 - esp32-hal/examples/embassy_spi.rs | 6 -- esp32-hal/examples/embassy_wait.rs | 7 -- esp32c2-hal/examples/embassy_i2c.rs | 2 - esp32c2-hal/examples/embassy_serial.rs | 2 - esp32c2-hal/examples/embassy_spi.rs | 6 -- esp32c2-hal/examples/embassy_wait.rs | 7 -- esp32c3-hal/examples/embassy_i2c.rs | 2 - esp32c3-hal/examples/embassy_i2s_read.rs | 7 -- esp32c3-hal/examples/embassy_i2s_sound.rs | 7 -- esp32c3-hal/examples/embassy_rmt_rx.rs | 7 -- esp32c3-hal/examples/embassy_rmt_tx.rs | 7 -- esp32c3-hal/examples/embassy_serial.rs | 2 - esp32c3-hal/examples/embassy_spi.rs | 6 -- .../examples/embassy_usb_serial_jtag.rs | 6 -- esp32c3-hal/examples/embassy_wait.rs | 7 -- esp32c6-hal/examples/embassy_i2c.rs | 2 - esp32c6-hal/examples/embassy_i2s_read.rs | 7 -- esp32c6-hal/examples/embassy_i2s_sound.rs | 7 -- esp32c6-hal/examples/embassy_parl_io_rx.rs | 7 -- esp32c6-hal/examples/embassy_parl_io_tx.rs | 7 -- esp32c6-hal/examples/embassy_rmt_rx.rs | 7 -- esp32c6-hal/examples/embassy_rmt_tx.rs | 7 -- esp32c6-hal/examples/embassy_serial.rs | 2 - esp32c6-hal/examples/embassy_spi.rs | 11 ---- .../examples/embassy_usb_serial_jtag.rs | 6 -- esp32c6-hal/examples/embassy_wait.rs | 7 -- esp32h2-hal/examples/embassy_i2c.rs | 2 - esp32h2-hal/examples/embassy_i2s_read.rs | 7 -- esp32h2-hal/examples/embassy_i2s_sound.rs | 7 -- esp32h2-hal/examples/embassy_parl_io_rx.rs | 7 -- esp32h2-hal/examples/embassy_parl_io_tx.rs | 7 -- esp32h2-hal/examples/embassy_rmt_rx.rs | 7 -- esp32h2-hal/examples/embassy_rmt_tx.rs | 7 -- esp32h2-hal/examples/embassy_serial.rs | 2 - esp32h2-hal/examples/embassy_spi.rs | 11 ---- .../examples/embassy_usb_serial_jtag.rs | 6 -- esp32h2-hal/examples/embassy_wait.rs | 7 -- esp32s2-hal/examples/embassy_i2c.rs | 2 - esp32s2-hal/examples/embassy_i2s_read.rs | 7 -- esp32s2-hal/examples/embassy_i2s_sound.rs | 7 -- esp32s2-hal/examples/embassy_rmt_rx.rs | 7 -- esp32s2-hal/examples/embassy_rmt_tx.rs | 7 -- esp32s2-hal/examples/embassy_serial.rs | 2 - esp32s2-hal/examples/embassy_spi.rs | 6 -- esp32s2-hal/examples/embassy_wait.rs | 7 -- esp32s3-hal/examples/embassy_i2c.rs | 2 - esp32s3-hal/examples/embassy_i2s_read.rs | 7 -- esp32s3-hal/examples/embassy_i2s_sound.rs | 7 -- esp32s3-hal/examples/embassy_rmt_rx.rs | 7 -- esp32s3-hal/examples/embassy_rmt_tx.rs | 7 -- esp32s3-hal/examples/embassy_serial.rs | 2 - esp32s3-hal/examples/embassy_spi.rs | 11 ---- .../examples/embassy_usb_serial_jtag.rs | 6 -- esp32s3-hal/examples/embassy_wait.rs | 7 -- 63 files changed, 67 insertions(+), 356 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bfe9f9290..e1e30c61f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,6 +34,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - S2 / S3: Don't require GPIO 18 to create a USB peripheral driver instance (#990) - Updated to latest release candidate (`1.0.0-rc.2`) for `embedded-hal{-async,-nb}` (#994) - Explicit panic when hitting the `DefaultHandler` (#1005) +- Relevant interrupts are now auto enabled in `embassy::init` (#1014). ### Fixed diff --git a/esp-hal-common/Cargo.toml b/esp-hal-common/Cargo.toml index 0a454f293..c0cf3ed4d 100644 --- a/esp-hal-common/Cargo.toml +++ b/esp-hal-common/Cargo.toml @@ -67,8 +67,8 @@ ufmt-write = { version = "0.1.0", optional = true } esp32 = { version = "0.28.0", features = ["critical-section"], optional = true } esp32c2 = { version = "0.16.0", features = ["critical-section"], optional = true } esp32c3 = { version = "0.19.0", features = ["critical-section"], optional = true } -esp32c6 = { version = "0.9.0", features = ["critical-section"], optional = true } -esp32h2 = { version = "0.5.0", features = ["critical-section"], optional = true } +esp32c6 = { version = "0.10.0", features = ["critical-section"], optional = true } +esp32h2 = { version = "0.6.0", features = ["critical-section"], optional = true } esp32s2 = { version = "0.19.0", features = ["critical-section"], optional = true } esp32s3 = { version = "0.23.0", features = ["critical-section"], optional = true } diff --git a/esp-hal-common/src/embassy/mod.rs b/esp-hal-common/src/embassy/mod.rs index 7c466acd0..331887f25 100644 --- a/esp-hal-common/src/embassy/mod.rs +++ b/esp-hal-common/src/embassy/mod.rs @@ -82,6 +82,8 @@ use core::cell::Cell; use embassy_time::driver::{AlarmHandle, Driver}; +use crate::{interrupt::Priority, peripherals::Interrupt}; + #[cfg_attr( all(systimer, feature = "embassy-time-systick"), path = "time_driver_systimer.rs" @@ -96,7 +98,69 @@ use time_driver::EmbassyTimer; use crate::clock::Clocks; +/// Initialise embassy, including setting up interrupts for the DMA and async +/// enabled peripherals. pub fn init(clocks: &Clocks, td: time_driver::TimerType) { + #[cfg(any(esp32s3, esp32c6, esp32h2))] + crate::interrupt::enable(Interrupt::DMA_IN_CH0, Priority::max()).unwrap(); + #[cfg(any(esp32s3, esp32c6, esp32h2))] + crate::interrupt::enable(Interrupt::DMA_OUT_CH0, Priority::max()).unwrap(); + #[cfg(any(esp32s3, esp32c6, esp32h2))] + crate::interrupt::enable(Interrupt::DMA_IN_CH1, Priority::max()).unwrap(); + #[cfg(any(esp32s3, esp32c6, esp32h2))] + crate::interrupt::enable(Interrupt::DMA_OUT_CH1, Priority::max()).unwrap(); + #[cfg(any(esp32s3, esp32c6, esp32h2))] + crate::interrupt::enable(Interrupt::DMA_IN_CH2, Priority::max()).unwrap(); + #[cfg(any(esp32s3, esp32c6, esp32h2))] + crate::interrupt::enable(Interrupt::DMA_OUT_CH2, Priority::max()).unwrap(); + + #[cfg(esp32s3)] + crate::interrupt::enable(Interrupt::DMA_IN_CH3, Priority::max()).unwrap(); + #[cfg(esp32s3)] + crate::interrupt::enable(Interrupt::DMA_OUT_CH3, Priority::max()).unwrap(); + + #[cfg(any(esp32c3, esp32c2))] + crate::interrupt::enable(Interrupt::DMA_CH0, Priority::max()).unwrap(); + #[cfg(esp32c3)] + crate::interrupt::enable(Interrupt::DMA_CH1, Priority::max()).unwrap(); + #[cfg(esp32c3)] + crate::interrupt::enable(Interrupt::DMA_CH2, Priority::max()).unwrap(); + + #[cfg(any(esp32))] + crate::interrupt::enable(Interrupt::SPI1_DMA, Priority::max()).unwrap(); + #[cfg(any(esp32, esp32s2))] + crate::interrupt::enable(Interrupt::SPI2_DMA, Priority::max()).unwrap(); + #[cfg(any(esp32, esp32s2))] + crate::interrupt::enable(Interrupt::SPI3_DMA, Priority::max()).unwrap(); + #[cfg(esp32s2)] + crate::interrupt::enable(Interrupt::SPI4_DMA, Priority::max()).unwrap(); + + #[cfg(i2s0)] + crate::interrupt::enable(Interrupt::I2S0, Priority::min()).unwrap(); + #[cfg(i2s1)] + crate::interrupt::enable(Interrupt::I2S1, Priority::min()).unwrap(); + + #[cfg(rmt)] + crate::interrupt::enable(Interrupt::RMT, Priority::min()).unwrap(); + + #[cfg(usb_device)] + crate::interrupt::enable(Interrupt::USB_DEVICE, Priority::min()).unwrap(); + + #[cfg(all(parl_io, not(esp32h2)))] + crate::interrupt::enable(Interrupt::PARL_IO, Priority::min()).unwrap(); + #[cfg(all(parl_io, esp32h2))] + crate::interrupt::enable(Interrupt::PARL_IO_RX, Priority::min()).unwrap(); + #[cfg(all(parl_io, esp32h2))] + crate::interrupt::enable(Interrupt::PARL_IO_TX, Priority::min()).unwrap(); + + #[cfg(uart0)] + crate::interrupt::enable(Interrupt::UART0, Priority::min()).unwrap(); + #[cfg(uart1)] + crate::interrupt::enable(Interrupt::UART1, Priority::min()).unwrap(); + + crate::interrupt::enable(Interrupt::I2C_EXT0, Priority::min()).unwrap(); + crate::interrupt::enable(Interrupt::GPIO, Priority::min()).unwrap(); + EmbassyTimer::init(clocks, td) } diff --git a/esp32-hal/examples/embassy_i2c.rs b/esp32-hal/examples/embassy_i2c.rs index 717b5c1e2..68078e630 100644 --- a/esp32-hal/examples/embassy_i2c.rs +++ b/esp32-hal/examples/embassy_i2c.rs @@ -48,8 +48,6 @@ async fn main(_spawner: Spawner) { &clocks, ); - interrupt::enable(Interrupt::I2C_EXT0, interrupt::Priority::Priority1).unwrap(); - let mut lis3dh = Lis3dh::new_i2c(i2c0, SlaveAddr::Alternate).await.unwrap(); lis3dh.set_range(Range::G8).await.unwrap(); diff --git a/esp32-hal/examples/embassy_i2s_read.rs b/esp32-hal/examples/embassy_i2s_read.rs index ff7a15ced..b3c1b9797 100644 --- a/esp32-hal/examples/embassy_i2s_read.rs +++ b/esp32-hal/examples/embassy_i2s_read.rs @@ -70,13 +70,6 @@ async fn main(_spawner: Spawner) { .with_din(io.pins.gpio14) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32_hal::interrupt::enable( - esp32_hal::peripherals::Interrupt::I2S0, - esp32_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; println!("Start"); diff --git a/esp32-hal/examples/embassy_i2s_sound.rs b/esp32-hal/examples/embassy_i2s_sound.rs index 9a6c648f8..9e1221f37 100644 --- a/esp32-hal/examples/embassy_i2s_sound.rs +++ b/esp32-hal/examples/embassy_i2s_sound.rs @@ -94,13 +94,6 @@ async fn main(_spawner: Spawner) { .with_dout(io.pins.gpio14) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32_hal::interrupt::enable( - esp32_hal::peripherals::Interrupt::I2S0, - esp32_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let data = unsafe { core::slice::from_raw_parts(&SINE as *const _ as *const u8, SINE.len() * 2) }; diff --git a/esp32-hal/examples/embassy_rmt_rx.rs b/esp32-hal/examples/embassy_rmt_rx.rs index 1ed414f88..004c51524 100644 --- a/esp32-hal/examples/embassy_rmt_rx.rs +++ b/esp32-hal/examples/embassy_rmt_rx.rs @@ -67,13 +67,6 @@ async fn main(spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32_hal::interrupt::enable( - esp32_hal::peripherals::Interrupt::RMT, - esp32_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - spawner .spawn(signal_task(io.pins.gpio15.into_push_pull_output())) .unwrap(); diff --git a/esp32-hal/examples/embassy_rmt_tx.rs b/esp32-hal/examples/embassy_rmt_tx.rs index e35dbada0..30377e82a 100644 --- a/esp32-hal/examples/embassy_rmt_tx.rs +++ b/esp32-hal/examples/embassy_rmt_tx.rs @@ -49,13 +49,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32_hal::interrupt::enable( - esp32_hal::peripherals::Interrupt::RMT, - esp32_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 200, diff --git a/esp32-hal/examples/embassy_serial.rs b/esp32-hal/examples/embassy_serial.rs index 9af6f1a42..5b0e1de17 100644 --- a/esp32-hal/examples/embassy_serial.rs +++ b/esp32-hal/examples/embassy_serial.rs @@ -90,8 +90,6 @@ async fn main(spawner: Spawner) { .unwrap(); let (tx, rx) = uart0.split(); - interrupt::enable(Interrupt::UART0, interrupt::Priority::Priority1).unwrap(); - let signal = &*make_static!(Signal::new()); spawner.spawn(reader(rx, &signal)).ok(); diff --git a/esp32-hal/examples/embassy_spi.rs b/esp32-hal/examples/embassy_spi.rs index 211f16a26..c5ad70986 100644 --- a/esp32-hal/examples/embassy_spi.rs +++ b/esp32-hal/examples/embassy_spi.rs @@ -47,12 +47,6 @@ async fn main(_spawner: Spawner) { let timer_group0 = TimerGroup::new(peripherals.TIMG0, &clocks); embassy::init(&clocks, timer_group0.timer0); - esp32_hal::interrupt::enable( - esp32_hal::peripherals::Interrupt::SPI2_DMA, - esp32_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); let sclk = io.pins.gpio19; let miso = io.pins.gpio25; diff --git a/esp32-hal/examples/embassy_wait.rs b/esp32-hal/examples/embassy_wait.rs index afc134ece..f7bdeb249 100644 --- a/esp32-hal/examples/embassy_wait.rs +++ b/esp32-hal/examples/embassy_wait.rs @@ -33,13 +33,6 @@ async fn main(_spawner: Spawner) { // GPIO 0 as input let mut input = io.pins.gpio0.into_pull_down_input(); - // Async requires the GPIO interrupt to wake futures - esp32_hal::interrupt::enable( - esp32_hal::peripherals::Interrupt::GPIO, - esp32_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - loop { esp_println::println!("Waiting..."); input.wait_for_rising_edge().await.unwrap(); diff --git a/esp32c2-hal/examples/embassy_i2c.rs b/esp32c2-hal/examples/embassy_i2c.rs index 6f7d0bf30..e365ce65e 100644 --- a/esp32c2-hal/examples/embassy_i2c.rs +++ b/esp32c2-hal/examples/embassy_i2c.rs @@ -56,8 +56,6 @@ async fn main(_spawner: Spawner) { &clocks, ); - interrupt::enable(Interrupt::I2C_EXT0, interrupt::Priority::Priority1).unwrap(); - let mut lis3dh = Lis3dh::new_i2c(i2c0, SlaveAddr::Alternate).await.unwrap(); lis3dh.set_range(Range::G8).await.unwrap(); diff --git a/esp32c2-hal/examples/embassy_serial.rs b/esp32c2-hal/examples/embassy_serial.rs index 3e2e85223..c1e4e2482 100644 --- a/esp32c2-hal/examples/embassy_serial.rs +++ b/esp32c2-hal/examples/embassy_serial.rs @@ -90,8 +90,6 @@ async fn main(spawner: Spawner) { .unwrap(); let (tx, rx) = uart0.split(); - interrupt::enable(Interrupt::UART0, interrupt::Priority::Priority1).unwrap(); - let signal = &*make_static!(Signal::new()); spawner.spawn(reader(rx, &signal)).ok(); diff --git a/esp32c2-hal/examples/embassy_spi.rs b/esp32c2-hal/examples/embassy_spi.rs index 6b63a901a..a0cfeffe4 100644 --- a/esp32c2-hal/examples/embassy_spi.rs +++ b/esp32c2-hal/examples/embassy_spi.rs @@ -55,12 +55,6 @@ async fn main(_spawner: Spawner) { esp32c2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks).timer0, ); - esp32c2_hal::interrupt::enable( - esp32c2_hal::peripherals::Interrupt::DMA_CH0, - esp32c2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); let sclk = io.pins.gpio6; let miso = io.pins.gpio2; diff --git a/esp32c2-hal/examples/embassy_wait.rs b/esp32c2-hal/examples/embassy_wait.rs index 09bd52d42..0a6713066 100644 --- a/esp32c2-hal/examples/embassy_wait.rs +++ b/esp32c2-hal/examples/embassy_wait.rs @@ -35,13 +35,6 @@ async fn main(_spawner: Spawner) { // GPIO 9 as input let mut input = io.pins.gpio9.into_pull_down_input(); - // Async requires the GPIO interrupt to wake futures - esp32c2_hal::interrupt::enable( - esp32c2_hal::peripherals::Interrupt::GPIO, - esp32c2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - loop { esp_println::println!("Waiting..."); input.wait_for_rising_edge().await.unwrap(); diff --git a/esp32c3-hal/examples/embassy_i2c.rs b/esp32c3-hal/examples/embassy_i2c.rs index a2a2f1362..4dbd7c6ea 100644 --- a/esp32c3-hal/examples/embassy_i2c.rs +++ b/esp32c3-hal/examples/embassy_i2c.rs @@ -56,8 +56,6 @@ async fn main(_spawner: Spawner) { &clocks, ); - interrupt::enable(Interrupt::I2C_EXT0, interrupt::Priority::Priority1).unwrap(); - let mut lis3dh = Lis3dh::new_i2c(i2c0, SlaveAddr::Alternate).await.unwrap(); lis3dh.set_range(Range::G8).await.unwrap(); diff --git a/esp32c3-hal/examples/embassy_i2s_read.rs b/esp32c3-hal/examples/embassy_i2s_read.rs index 23f5d89d0..c68518076 100644 --- a/esp32c3-hal/examples/embassy_i2s_read.rs +++ b/esp32c3-hal/examples/embassy_i2s_read.rs @@ -80,13 +80,6 @@ async fn main(_spawner: Spawner) { .with_din(io.pins.gpio5) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32c3_hal::interrupt::enable( - esp32c3_hal::peripherals::Interrupt::DMA_CH0, - esp32c3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; println!("Start"); diff --git a/esp32c3-hal/examples/embassy_i2s_sound.rs b/esp32c3-hal/examples/embassy_i2s_sound.rs index ec81d48e4..23dab12fe 100644 --- a/esp32c3-hal/examples/embassy_i2s_sound.rs +++ b/esp32c3-hal/examples/embassy_i2s_sound.rs @@ -104,13 +104,6 @@ async fn main(_spawner: Spawner) { .with_dout(io.pins.gpio3) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32c3_hal::interrupt::enable( - esp32c3_hal::peripherals::Interrupt::DMA_CH0, - esp32c3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let data = unsafe { core::slice::from_raw_parts(&SINE as *const _ as *const u8, SINE.len() * 2) }; diff --git a/esp32c3-hal/examples/embassy_rmt_rx.rs b/esp32c3-hal/examples/embassy_rmt_rx.rs index cee341a43..c4f809235 100644 --- a/esp32c3-hal/examples/embassy_rmt_rx.rs +++ b/esp32c3-hal/examples/embassy_rmt_rx.rs @@ -59,13 +59,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32c3_hal::interrupt::enable( - esp32c3_hal::peripherals::Interrupt::RMT, - esp32c3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 1, diff --git a/esp32c3-hal/examples/embassy_rmt_tx.rs b/esp32c3-hal/examples/embassy_rmt_tx.rs index 9190d25dd..e4e0f6248 100644 --- a/esp32c3-hal/examples/embassy_rmt_tx.rs +++ b/esp32c3-hal/examples/embassy_rmt_tx.rs @@ -55,13 +55,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32c3_hal::interrupt::enable( - esp32c3_hal::peripherals::Interrupt::RMT, - esp32c3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 200, diff --git a/esp32c3-hal/examples/embassy_serial.rs b/esp32c3-hal/examples/embassy_serial.rs index 79f493a09..e946d31fb 100644 --- a/esp32c3-hal/examples/embassy_serial.rs +++ b/esp32c3-hal/examples/embassy_serial.rs @@ -90,8 +90,6 @@ async fn main(spawner: Spawner) { .unwrap(); let (tx, rx) = uart0.split(); - interrupt::enable(Interrupt::UART0, interrupt::Priority::Priority1).unwrap(); - let signal = &*make_static!(Signal::new()); spawner.spawn(reader(rx, &signal)).ok(); diff --git a/esp32c3-hal/examples/embassy_spi.rs b/esp32c3-hal/examples/embassy_spi.rs index 745d7dc60..fadd5c79a 100644 --- a/esp32c3-hal/examples/embassy_spi.rs +++ b/esp32c3-hal/examples/embassy_spi.rs @@ -55,12 +55,6 @@ async fn main(_spawner: Spawner) { esp32c3_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks).timer0, ); - esp32c3_hal::interrupt::enable( - esp32c3_hal::peripherals::Interrupt::DMA_CH0, - esp32c3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); let sclk = io.pins.gpio6; let miso = io.pins.gpio2; diff --git a/esp32c3-hal/examples/embassy_usb_serial_jtag.rs b/esp32c3-hal/examples/embassy_usb_serial_jtag.rs index 9ddd28e7d..a7b92883c 100644 --- a/esp32c3-hal/examples/embassy_usb_serial_jtag.rs +++ b/esp32c3-hal/examples/embassy_usb_serial_jtag.rs @@ -38,12 +38,6 @@ async fn main(_spawner: Spawner) -> ! { esp32c3_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks).timer0, ); - interrupt::enable( - peripherals::Interrupt::USB_DEVICE, - interrupt::Priority::Priority1, - ) - .unwrap(); - let mut usb_serial = UsbSerialJtag::new(peripherals.USB_DEVICE); loop { diff --git a/esp32c3-hal/examples/embassy_wait.rs b/esp32c3-hal/examples/embassy_wait.rs index dbe4c2a64..14ab09d58 100644 --- a/esp32c3-hal/examples/embassy_wait.rs +++ b/esp32c3-hal/examples/embassy_wait.rs @@ -35,13 +35,6 @@ async fn main(_spawner: Spawner) { // GPIO 9 as input let mut input = io.pins.gpio9.into_pull_down_input(); - // Async requires the GPIO interrupt to wake futures - esp32c3_hal::interrupt::enable( - esp32c3_hal::peripherals::Interrupt::GPIO, - esp32c3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - loop { esp_println::println!("Waiting..."); input.wait_for_rising_edge().await.unwrap(); diff --git a/esp32c6-hal/examples/embassy_i2c.rs b/esp32c6-hal/examples/embassy_i2c.rs index 80038240b..9ccaf4428 100644 --- a/esp32c6-hal/examples/embassy_i2c.rs +++ b/esp32c6-hal/examples/embassy_i2c.rs @@ -56,8 +56,6 @@ async fn main(_spawner: Spawner) { &clocks, ); - interrupt::enable(Interrupt::I2C_EXT0, interrupt::Priority::Priority1).unwrap(); - let mut lis3dh = Lis3dh::new_i2c(i2c0, SlaveAddr::Alternate).await.unwrap(); lis3dh.set_range(Range::G8).await.unwrap(); diff --git a/esp32c6-hal/examples/embassy_i2s_read.rs b/esp32c6-hal/examples/embassy_i2s_read.rs index e8c6b85e4..f56b30f73 100644 --- a/esp32c6-hal/examples/embassy_i2s_read.rs +++ b/esp32c6-hal/examples/embassy_i2s_read.rs @@ -80,13 +80,6 @@ async fn main(_spawner: Spawner) { .with_din(io.pins.gpio5) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32c6_hal::interrupt::enable( - esp32c6_hal::peripherals::Interrupt::DMA_IN_CH0, - esp32c6_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; println!("Start"); diff --git a/esp32c6-hal/examples/embassy_i2s_sound.rs b/esp32c6-hal/examples/embassy_i2s_sound.rs index 9dbe1d357..7d2751ecc 100644 --- a/esp32c6-hal/examples/embassy_i2s_sound.rs +++ b/esp32c6-hal/examples/embassy_i2s_sound.rs @@ -104,13 +104,6 @@ async fn main(_spawner: Spawner) { .with_dout(io.pins.gpio3) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32c6_hal::interrupt::enable( - esp32c6_hal::peripherals::Interrupt::DMA_OUT_CH0, - esp32c6_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let data = unsafe { core::slice::from_raw_parts(&SINE as *const _ as *const u8, SINE.len() * 2) }; diff --git a/esp32c6-hal/examples/embassy_parl_io_rx.rs b/esp32c6-hal/examples/embassy_parl_io_rx.rs index 9ae3c484c..618863de3 100644 --- a/esp32c6-hal/examples/embassy_parl_io_rx.rs +++ b/esp32c6-hal/examples/embassy_parl_io_rx.rs @@ -71,13 +71,6 @@ async fn main(_spawner: Spawner) { .with_config(rx_pins, NoClkPin, BitPackOrder::Msb, Some(0xfff)) .unwrap(); - // you need to manually enable the DMA channel's interrupt! - interrupt::enable( - peripherals::Interrupt::DMA_IN_CH0, - interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; loop { parl_io_rx.read_dma_async(buffer).await.unwrap(); diff --git a/esp32c6-hal/examples/embassy_parl_io_tx.rs b/esp32c6-hal/examples/embassy_parl_io_tx.rs index 2846c3047..cc7d38317 100644 --- a/esp32c6-hal/examples/embassy_parl_io_tx.rs +++ b/esp32c6-hal/examples/embassy_parl_io_tx.rs @@ -92,13 +92,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you need to manually enable the DMA channel's interrupt! - interrupt::enable( - peripherals::Interrupt::PARL_IO, - interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = tx_buffer; for i in 0..buffer.len() { buffer[i] = (i % 255) as u8; diff --git a/esp32c6-hal/examples/embassy_rmt_rx.rs b/esp32c6-hal/examples/embassy_rmt_rx.rs index 5d858fe8a..2751179cb 100644 --- a/esp32c6-hal/examples/embassy_rmt_rx.rs +++ b/esp32c6-hal/examples/embassy_rmt_rx.rs @@ -59,13 +59,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32c6_hal::interrupt::enable( - esp32c6_hal::peripherals::Interrupt::RMT, - esp32c6_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 1, diff --git a/esp32c6-hal/examples/embassy_rmt_tx.rs b/esp32c6-hal/examples/embassy_rmt_tx.rs index 39bae9ae2..56eec9f5b 100644 --- a/esp32c6-hal/examples/embassy_rmt_tx.rs +++ b/esp32c6-hal/examples/embassy_rmt_tx.rs @@ -55,13 +55,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32c6_hal::interrupt::enable( - esp32c6_hal::peripherals::Interrupt::RMT, - esp32c6_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 200, diff --git a/esp32c6-hal/examples/embassy_serial.rs b/esp32c6-hal/examples/embassy_serial.rs index 378a75b21..c7ff7906b 100644 --- a/esp32c6-hal/examples/embassy_serial.rs +++ b/esp32c6-hal/examples/embassy_serial.rs @@ -90,8 +90,6 @@ async fn main(spawner: Spawner) { .unwrap(); let (tx, rx) = uart0.split(); - interrupt::enable(Interrupt::UART0, interrupt::Priority::Priority1).unwrap(); - let signal = &*make_static!(Signal::new()); spawner.spawn(reader(rx, &signal)).ok(); diff --git a/esp32c6-hal/examples/embassy_spi.rs b/esp32c6-hal/examples/embassy_spi.rs index 54c0278a6..c7d28fa03 100644 --- a/esp32c6-hal/examples/embassy_spi.rs +++ b/esp32c6-hal/examples/embassy_spi.rs @@ -55,17 +55,6 @@ async fn main(_spawner: Spawner) { embassy::init(&clocks, timer_group0.timer0); } - esp32c6_hal::interrupt::enable( - esp32c6_hal::peripherals::Interrupt::DMA_IN_CH0, - esp32c6_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - esp32c6_hal::interrupt::enable( - esp32c6_hal::peripherals::Interrupt::DMA_OUT_CH0, - esp32c6_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); let sclk = io.pins.gpio6; let miso = io.pins.gpio2; diff --git a/esp32c6-hal/examples/embassy_usb_serial_jtag.rs b/esp32c6-hal/examples/embassy_usb_serial_jtag.rs index 53a52187c..d570946d0 100644 --- a/esp32c6-hal/examples/embassy_usb_serial_jtag.rs +++ b/esp32c6-hal/examples/embassy_usb_serial_jtag.rs @@ -37,12 +37,6 @@ async fn main(_spawner: Spawner) -> ! { esp32c6_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks).timer0, ); - interrupt::enable( - peripherals::Interrupt::USB_DEVICE, - interrupt::Priority::Priority1, - ) - .unwrap(); - let mut usb_serial = UsbSerialJtag::new(peripherals.USB_DEVICE); loop { diff --git a/esp32c6-hal/examples/embassy_wait.rs b/esp32c6-hal/examples/embassy_wait.rs index cec0333c3..01e21351c 100644 --- a/esp32c6-hal/examples/embassy_wait.rs +++ b/esp32c6-hal/examples/embassy_wait.rs @@ -35,13 +35,6 @@ async fn main(_spawner: Spawner) { // GPIO 9 as input let mut input = io.pins.gpio9.into_pull_down_input(); - // Async requires the GPIO interrupt to wake futures - esp32c6_hal::interrupt::enable( - esp32c6_hal::peripherals::Interrupt::GPIO, - esp32c6_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - loop { esp_println::println!("Waiting..."); input.wait_for_rising_edge().await.unwrap(); diff --git a/esp32h2-hal/examples/embassy_i2c.rs b/esp32h2-hal/examples/embassy_i2c.rs index 6117e5ff6..83a573440 100644 --- a/esp32h2-hal/examples/embassy_i2c.rs +++ b/esp32h2-hal/examples/embassy_i2c.rs @@ -56,8 +56,6 @@ async fn main(_spawner: Spawner) { &clocks, ); - interrupt::enable(Interrupt::I2C_EXT0, interrupt::Priority::Priority1).unwrap(); - let mut lis3dh = Lis3dh::new_i2c(i2c0, SlaveAddr::Alternate).await.unwrap(); lis3dh.set_range(Range::G8).await.unwrap(); diff --git a/esp32h2-hal/examples/embassy_i2s_read.rs b/esp32h2-hal/examples/embassy_i2s_read.rs index 7baed4c9e..73c4702b7 100644 --- a/esp32h2-hal/examples/embassy_i2s_read.rs +++ b/esp32h2-hal/examples/embassy_i2s_read.rs @@ -80,13 +80,6 @@ async fn main(_spawner: Spawner) { .with_din(io.pins.gpio5) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32h2_hal::interrupt::enable( - esp32h2_hal::peripherals::Interrupt::DMA_IN_CH0, - esp32h2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; println!("Start"); diff --git a/esp32h2-hal/examples/embassy_i2s_sound.rs b/esp32h2-hal/examples/embassy_i2s_sound.rs index cf28be95c..afb65d6ee 100644 --- a/esp32h2-hal/examples/embassy_i2s_sound.rs +++ b/esp32h2-hal/examples/embassy_i2s_sound.rs @@ -104,13 +104,6 @@ async fn main(_spawner: Spawner) { .with_dout(io.pins.gpio3) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32h2_hal::interrupt::enable( - esp32h2_hal::peripherals::Interrupt::DMA_OUT_CH0, - esp32h2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let data = unsafe { core::slice::from_raw_parts(&SINE as *const _ as *const u8, SINE.len() * 2) }; diff --git a/esp32h2-hal/examples/embassy_parl_io_rx.rs b/esp32h2-hal/examples/embassy_parl_io_rx.rs index cb4bdfdc9..3492643e3 100644 --- a/esp32h2-hal/examples/embassy_parl_io_rx.rs +++ b/esp32h2-hal/examples/embassy_parl_io_rx.rs @@ -71,13 +71,6 @@ async fn main(_spawner: Spawner) { .with_config(rx_pins, NoClkPin, BitPackOrder::Msb, Some(0xfff)) .unwrap(); - // you need to manually enable the DMA channel's interrupt! - interrupt::enable( - peripherals::Interrupt::DMA_IN_CH0, - interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; loop { parl_io_rx.read_dma_async(buffer).await.unwrap(); diff --git a/esp32h2-hal/examples/embassy_parl_io_tx.rs b/esp32h2-hal/examples/embassy_parl_io_tx.rs index 0663712ef..944d12ce2 100644 --- a/esp32h2-hal/examples/embassy_parl_io_tx.rs +++ b/esp32h2-hal/examples/embassy_parl_io_tx.rs @@ -92,13 +92,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you need to manually enable the DMA channel's interrupt! - interrupt::enable( - peripherals::Interrupt::PARL_IO_TX, - interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = tx_buffer; for i in 0..buffer.len() { buffer[i] = (i % 255) as u8; diff --git a/esp32h2-hal/examples/embassy_rmt_rx.rs b/esp32h2-hal/examples/embassy_rmt_rx.rs index 36f1ecd78..c4531d46f 100644 --- a/esp32h2-hal/examples/embassy_rmt_rx.rs +++ b/esp32h2-hal/examples/embassy_rmt_rx.rs @@ -59,13 +59,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32h2_hal::interrupt::enable( - esp32h2_hal::peripherals::Interrupt::RMT, - esp32h2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 1, diff --git a/esp32h2-hal/examples/embassy_rmt_tx.rs b/esp32h2-hal/examples/embassy_rmt_tx.rs index a7a431f9c..7a3671eb7 100644 --- a/esp32h2-hal/examples/embassy_rmt_tx.rs +++ b/esp32h2-hal/examples/embassy_rmt_tx.rs @@ -55,13 +55,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32h2_hal::interrupt::enable( - esp32h2_hal::peripherals::Interrupt::RMT, - esp32h2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 200, diff --git a/esp32h2-hal/examples/embassy_serial.rs b/esp32h2-hal/examples/embassy_serial.rs index dd0ad91ca..9eade9f16 100644 --- a/esp32h2-hal/examples/embassy_serial.rs +++ b/esp32h2-hal/examples/embassy_serial.rs @@ -90,8 +90,6 @@ async fn main(spawner: Spawner) { .unwrap(); let (tx, rx) = uart0.split(); - interrupt::enable(Interrupt::UART0, interrupt::Priority::Priority1).unwrap(); - let signal = &*make_static!(Signal::new()); spawner.spawn(reader(rx, &signal)).ok(); diff --git a/esp32h2-hal/examples/embassy_spi.rs b/esp32h2-hal/examples/embassy_spi.rs index d4c4fc1b9..cd0bf520f 100644 --- a/esp32h2-hal/examples/embassy_spi.rs +++ b/esp32h2-hal/examples/embassy_spi.rs @@ -55,17 +55,6 @@ async fn main(_spawner: Spawner) { embassy::init(&clocks, timer_group0.timer0); } - esp32h2_hal::interrupt::enable( - esp32h2_hal::peripherals::Interrupt::DMA_IN_CH0, - esp32h2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - esp32h2_hal::interrupt::enable( - esp32h2_hal::peripherals::Interrupt::DMA_OUT_CH0, - esp32h2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); let sclk = io.pins.gpio1; let miso = io.pins.gpio2; diff --git a/esp32h2-hal/examples/embassy_usb_serial_jtag.rs b/esp32h2-hal/examples/embassy_usb_serial_jtag.rs index a4448a329..d4cde6784 100644 --- a/esp32h2-hal/examples/embassy_usb_serial_jtag.rs +++ b/esp32h2-hal/examples/embassy_usb_serial_jtag.rs @@ -37,12 +37,6 @@ async fn main(_spawner: Spawner) -> ! { esp32h2_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks).timer0, ); - interrupt::enable( - peripherals::Interrupt::USB_DEVICE, - interrupt::Priority::Priority1, - ) - .unwrap(); - let mut usb_serial = UsbSerialJtag::new(peripherals.USB_DEVICE); loop { diff --git a/esp32h2-hal/examples/embassy_wait.rs b/esp32h2-hal/examples/embassy_wait.rs index 52ad8fdfb..12075eded 100644 --- a/esp32h2-hal/examples/embassy_wait.rs +++ b/esp32h2-hal/examples/embassy_wait.rs @@ -35,13 +35,6 @@ async fn main(_spawner: Spawner) { // GPIO 9 as input let mut input = io.pins.gpio9.into_pull_down_input(); - // Async requires the GPIO interrupt to wake futures - esp32h2_hal::interrupt::enable( - esp32h2_hal::peripherals::Interrupt::GPIO, - esp32h2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - loop { esp_println::println!("Waiting..."); input.wait_for_rising_edge().await.unwrap(); diff --git a/esp32s2-hal/examples/embassy_i2c.rs b/esp32s2-hal/examples/embassy_i2c.rs index d3b08d0c3..320207a62 100644 --- a/esp32s2-hal/examples/embassy_i2c.rs +++ b/esp32s2-hal/examples/embassy_i2c.rs @@ -56,8 +56,6 @@ async fn main(_spawner: Spawner) { &clocks, ); - interrupt::enable(Interrupt::I2C_EXT0, interrupt::Priority::Priority1).unwrap(); - let mut lis3dh = Lis3dh::new_i2c(i2c0, SlaveAddr::Alternate).await.unwrap(); lis3dh.set_range(Range::G8).await.unwrap(); diff --git a/esp32s2-hal/examples/embassy_i2s_read.rs b/esp32s2-hal/examples/embassy_i2s_read.rs index 5676eaa7f..a55c26fa1 100644 --- a/esp32s2-hal/examples/embassy_i2s_read.rs +++ b/esp32s2-hal/examples/embassy_i2s_read.rs @@ -78,13 +78,6 @@ async fn main(_spawner: Spawner) { .with_din(io.pins.gpio5) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32s2_hal::interrupt::enable( - esp32s2_hal::peripherals::Interrupt::I2S0, - esp32s2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; println!("Start"); diff --git a/esp32s2-hal/examples/embassy_i2s_sound.rs b/esp32s2-hal/examples/embassy_i2s_sound.rs index 3c781b469..cbb0684d7 100644 --- a/esp32s2-hal/examples/embassy_i2s_sound.rs +++ b/esp32s2-hal/examples/embassy_i2s_sound.rs @@ -103,13 +103,6 @@ async fn main(_spawner: Spawner) { .with_dout(io.pins.gpio3) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32s2_hal::interrupt::enable( - esp32s2_hal::peripherals::Interrupt::I2S0, - esp32s2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let data = unsafe { core::slice::from_raw_parts(&SINE as *const _ as *const u8, SINE.len() * 2) }; diff --git a/esp32s2-hal/examples/embassy_rmt_rx.rs b/esp32s2-hal/examples/embassy_rmt_rx.rs index 721caa04d..25cd17101 100644 --- a/esp32s2-hal/examples/embassy_rmt_rx.rs +++ b/esp32s2-hal/examples/embassy_rmt_rx.rs @@ -73,13 +73,6 @@ async fn main(spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32s2_hal::interrupt::enable( - esp32s2_hal::peripherals::Interrupt::RMT, - esp32s2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - spawner .spawn(signal_task(io.pins.gpio15.into_push_pull_output())) .ok(); diff --git a/esp32s2-hal/examples/embassy_rmt_tx.rs b/esp32s2-hal/examples/embassy_rmt_tx.rs index 58a9e6084..2fc1bff3d 100644 --- a/esp32s2-hal/examples/embassy_rmt_tx.rs +++ b/esp32s2-hal/examples/embassy_rmt_tx.rs @@ -55,13 +55,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32s2_hal::interrupt::enable( - esp32s2_hal::peripherals::Interrupt::RMT, - esp32s2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 200, diff --git a/esp32s2-hal/examples/embassy_serial.rs b/esp32s2-hal/examples/embassy_serial.rs index 915bf494c..35ba98ff8 100644 --- a/esp32s2-hal/examples/embassy_serial.rs +++ b/esp32s2-hal/examples/embassy_serial.rs @@ -90,8 +90,6 @@ async fn main(spawner: Spawner) { .unwrap(); let (tx, rx) = uart0.split(); - interrupt::enable(Interrupt::UART0, interrupt::Priority::Priority1).unwrap(); - let signal = &*make_static!(Signal::new()); spawner.spawn(reader(rx, &signal)).ok(); diff --git a/esp32s2-hal/examples/embassy_spi.rs b/esp32s2-hal/examples/embassy_spi.rs index d4603b3c3..cac042183 100644 --- a/esp32s2-hal/examples/embassy_spi.rs +++ b/esp32s2-hal/examples/embassy_spi.rs @@ -55,12 +55,6 @@ async fn main(_spawner: Spawner) { embassy::init(&clocks, timer_group0.timer0); } - esp32s2_hal::interrupt::enable( - esp32s2_hal::peripherals::Interrupt::SPI2_DMA, - esp32s2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); let sclk = io.pins.gpio36; let miso = io.pins.gpio37; diff --git a/esp32s2-hal/examples/embassy_wait.rs b/esp32s2-hal/examples/embassy_wait.rs index 2d9d5b4f2..55b751c31 100644 --- a/esp32s2-hal/examples/embassy_wait.rs +++ b/esp32s2-hal/examples/embassy_wait.rs @@ -41,13 +41,6 @@ async fn main(_spawner: Spawner) { // GPIO 0 as input let mut input = io.pins.gpio0.into_pull_down_input(); - // Async requires the GPIO interrupt to wake futures - esp32s2_hal::interrupt::enable( - esp32s2_hal::peripherals::Interrupt::GPIO, - esp32s2_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - loop { esp_println::println!("Waiting..."); input.wait_for_rising_edge().await.unwrap(); diff --git a/esp32s3-hal/examples/embassy_i2c.rs b/esp32s3-hal/examples/embassy_i2c.rs index 3034dd52f..2205c6fc4 100644 --- a/esp32s3-hal/examples/embassy_i2c.rs +++ b/esp32s3-hal/examples/embassy_i2c.rs @@ -56,8 +56,6 @@ async fn main(_spawner: Spawner) { &clocks, ); - interrupt::enable(Interrupt::I2C_EXT0, interrupt::Priority::Priority1).unwrap(); - let mut lis3dh = Lis3dh::new_i2c(i2c0, SlaveAddr::Alternate).await.unwrap(); lis3dh.set_range(Range::G8).await.unwrap(); diff --git a/esp32s3-hal/examples/embassy_i2s_read.rs b/esp32s3-hal/examples/embassy_i2s_read.rs index e01eb8348..64f1f9d75 100644 --- a/esp32s3-hal/examples/embassy_i2s_read.rs +++ b/esp32s3-hal/examples/embassy_i2s_read.rs @@ -80,13 +80,6 @@ async fn main(_spawner: Spawner) { .with_din(io.pins.gpio5) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32s3_hal::interrupt::enable( - esp32s3_hal::peripherals::Interrupt::DMA_IN_CH0, - esp32s3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let buffer = rx_buffer; println!("Start"); diff --git a/esp32s3-hal/examples/embassy_i2s_sound.rs b/esp32s3-hal/examples/embassy_i2s_sound.rs index c74b4df74..8951389aa 100644 --- a/esp32s3-hal/examples/embassy_i2s_sound.rs +++ b/esp32s3-hal/examples/embassy_i2s_sound.rs @@ -104,13 +104,6 @@ async fn main(_spawner: Spawner) { .with_dout(io.pins.gpio3) .build(); - // you need to manually enable the DMA channel's interrupt! - esp32s3_hal::interrupt::enable( - esp32s3_hal::peripherals::Interrupt::DMA_OUT_CH0, - esp32s3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let data = unsafe { core::slice::from_raw_parts(&SINE as *const _ as *const u8, SINE.len() * 2) }; diff --git a/esp32s3-hal/examples/embassy_rmt_rx.rs b/esp32s3-hal/examples/embassy_rmt_rx.rs index da7e6c936..f24f18cd7 100644 --- a/esp32s3-hal/examples/embassy_rmt_rx.rs +++ b/esp32s3-hal/examples/embassy_rmt_rx.rs @@ -59,13 +59,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32s3_hal::interrupt::enable( - esp32s3_hal::peripherals::Interrupt::RMT, - esp32s3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 1, diff --git a/esp32s3-hal/examples/embassy_rmt_tx.rs b/esp32s3-hal/examples/embassy_rmt_tx.rs index b13850365..2398f1776 100644 --- a/esp32s3-hal/examples/embassy_rmt_tx.rs +++ b/esp32s3-hal/examples/embassy_rmt_tx.rs @@ -55,13 +55,6 @@ async fn main(_spawner: Spawner) { ) .unwrap(); - // you have to enable the interrupt for async to work - esp32s3_hal::interrupt::enable( - esp32s3_hal::peripherals::Interrupt::RMT, - esp32s3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let mut data = [PulseCode { level1: true, length1: 200, diff --git a/esp32s3-hal/examples/embassy_serial.rs b/esp32s3-hal/examples/embassy_serial.rs index 53746767c..4d8d9081d 100644 --- a/esp32s3-hal/examples/embassy_serial.rs +++ b/esp32s3-hal/examples/embassy_serial.rs @@ -90,8 +90,6 @@ async fn main(spawner: Spawner) { .unwrap(); let (tx, rx) = uart0.split(); - interrupt::enable(Interrupt::UART0, interrupt::Priority::Priority1).unwrap(); - let signal = &*make_static!(Signal::new()); spawner.spawn(reader(rx, &signal)).ok(); diff --git a/esp32s3-hal/examples/embassy_spi.rs b/esp32s3-hal/examples/embassy_spi.rs index 8d6a5a943..82ab93c96 100644 --- a/esp32s3-hal/examples/embassy_spi.rs +++ b/esp32s3-hal/examples/embassy_spi.rs @@ -55,17 +55,6 @@ async fn main(_spawner: Spawner) { embassy::init(&clocks, timer_group0.timer0); } - esp32s3_hal::interrupt::enable( - esp32s3_hal::peripherals::Interrupt::DMA_IN_CH0, - esp32s3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - esp32s3_hal::interrupt::enable( - esp32s3_hal::peripherals::Interrupt::DMA_OUT_CH0, - esp32s3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - let io = IO::new(peripherals.GPIO, peripherals.IO_MUX); let sclk = io.pins.gpio6; let miso = io.pins.gpio2; diff --git a/esp32s3-hal/examples/embassy_usb_serial_jtag.rs b/esp32s3-hal/examples/embassy_usb_serial_jtag.rs index 38f66a1d9..d7ef5b4b1 100644 --- a/esp32s3-hal/examples/embassy_usb_serial_jtag.rs +++ b/esp32s3-hal/examples/embassy_usb_serial_jtag.rs @@ -37,12 +37,6 @@ async fn main(_spawner: Spawner) -> ! { esp32s3_hal::timer::TimerGroup::new(peripherals.TIMG0, &clocks).timer0, ); - interrupt::enable( - peripherals::Interrupt::USB_DEVICE, - interrupt::Priority::Priority1, - ) - .unwrap(); - let mut usb_serial = UsbSerialJtag::new(peripherals.USB_DEVICE); loop { diff --git a/esp32s3-hal/examples/embassy_wait.rs b/esp32s3-hal/examples/embassy_wait.rs index 8e88ae71b..e4b5fb249 100644 --- a/esp32s3-hal/examples/embassy_wait.rs +++ b/esp32s3-hal/examples/embassy_wait.rs @@ -41,13 +41,6 @@ async fn main(_spawner: Spawner) { // GPIO 0 as input let mut input = io.pins.gpio0.into_pull_down_input(); - // Async requires the GPIO interrupt to wake futures - esp32s3_hal::interrupt::enable( - esp32s3_hal::peripherals::Interrupt::GPIO, - esp32s3_hal::interrupt::Priority::Priority1, - ) - .unwrap(); - loop { esp_println::println!("Waiting..."); input.wait_for_rising_edge().await.unwrap();