Skip to content

Commit d0f8331

Browse files
committed
Async GPIO Pull Request corrections
1 parent dcd86ea commit d0f8331

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

e310x-hal/src/asynch/digital.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ macro_rules! gpio_async {
1515
use crate::gpio::*;
1616
use crate::gpio::gpio0::*;
1717
use e310x::$GPIOX;
18+
use e310x::interrupt::ExternalInterrupt;
1819
use embedded_hal::digital::{Error, ErrorKind, ErrorType, InputPin};
1920
use embedded_hal_async::digital::Wait;
2021

@@ -38,8 +39,9 @@ macro_rules! gpio_async {
3839
}
3940

4041
/// Interrupt handler for GPIO pins.
42+
#[inline]
4143
fn on_irq(pin_n: usize) {
42-
let gpio_block = unsafe { Gpio0::steal() };
44+
let gpio_block = unsafe { $GPIOX::steal() };
4345
let pin_mask = 1 << pin_n;
4446

4547
// Disable the interrupt for the pin
@@ -231,7 +233,7 @@ macro_rules! gpio_async {
231233
}
232234

233235
/// Pin Interrupt Handler
234-
#[riscv_rt::external_interrupt(e310x::interrupt::ExternalInterrupt::$handle)]
236+
#[riscv_rt::external_interrupt(ExternalInterrupt::$handle)]
235237
fn $pxi() {
236238
on_irq($i);
237239
}

0 commit comments

Comments
 (0)