Skip to content

Commit

Permalink
Don't use #[interrupt] in GPIO driver
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoernQ committed Mar 13, 2024
1 parent 6046528 commit e0a7515
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions esp-hal/src/gpio.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
use core::{cell::Cell, convert::Infallible, marker::PhantomData};

use critical_section::Mutex;
use procmacros::interrupt;
use procmacros::handler;

#[cfg(any(adc, dac))]
pub(crate) use crate::analog;
Expand Down Expand Up @@ -1852,7 +1852,9 @@ pub struct IO {
}

impl IO {
pub fn new(gpio: GPIO, io_mux: IO_MUX) -> Self {
pub fn new(mut gpio: GPIO, io_mux: IO_MUX) -> Self {
gpio.bind_gpio_interrupt(gpio_interrupt_handler);

let pins = gpio.split();

IO {
Expand All @@ -1875,8 +1877,8 @@ impl IO {
}
}

#[interrupt]
unsafe fn GPIO() {
#[handler]
unsafe fn gpio_interrupt_handler() {
if let Some(user_handler) = critical_section::with(|cs| USER_INTERRUPT_HANDLER.borrow(cs).get())
{
unsafe {
Expand Down

0 comments on commit e0a7515

Please sign in to comment.