Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use #[interrupt] in GPIO driver #1278

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading