mirror of
https://github.com/esp-rs/esp-hal.git
synced 2025-10-02 14:44:42 +00:00
Don't use #[interrupt]
in GPIO driver (#1278)
This commit is contained in:
parent
6046528e0b
commit
1d3fa8e93b
@ -25,7 +25,7 @@
|
|||||||
use core::{cell::Cell, convert::Infallible, marker::PhantomData};
|
use core::{cell::Cell, convert::Infallible, marker::PhantomData};
|
||||||
|
|
||||||
use critical_section::Mutex;
|
use critical_section::Mutex;
|
||||||
use procmacros::interrupt;
|
use procmacros::handler;
|
||||||
|
|
||||||
#[cfg(any(adc, dac))]
|
#[cfg(any(adc, dac))]
|
||||||
pub(crate) use crate::analog;
|
pub(crate) use crate::analog;
|
||||||
@ -1852,7 +1852,9 @@ pub struct IO {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl 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();
|
let pins = gpio.split();
|
||||||
|
|
||||||
IO {
|
IO {
|
||||||
@ -1875,8 +1877,8 @@ impl IO {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[interrupt]
|
#[handler]
|
||||||
unsafe fn GPIO() {
|
unsafe fn gpio_interrupt_handler() {
|
||||||
if let Some(user_handler) = critical_section::with(|cs| USER_INTERRUPT_HANDLER.borrow(cs).get())
|
if let Some(user_handler) = critical_section::with(|cs| USER_INTERRUPT_HANDLER.borrow(cs).get())
|
||||||
{
|
{
|
||||||
unsafe {
|
unsafe {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user