-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
In the develop branch, after #850 was merged, it seems like the GPIO sent to the user callback is not correct.
I have called the init function as follows for any change on GPIO 9:
gpio_set_irq_enabled_with_callback(9 /*gpio #9*/, 12 /* rise or fall */, true /*enabled*/, _gpioInterruptDispatcher /* userland irq handler */);
When I set a breakpoint in GDB I can see that a toggle on GPIO #9 does result in a callback to the SDK gpio_default_irq_handler(), so the interrupt enables are set properly, but the callback routine gets called with 8 as the interrupting GPIO, not 9.
Right now the code is only returning GPIO 0, 8, 16, or 24:
pico-sdk/src/rp2_common/hardware_gpio/gpio.c
Lines 152 to 157 in 4c49427
| if (events && !(raw_irq_mask[core] & (1u << i))) { | |
| gpio_acknowledge_irq(i, events); | |
| if (callback) { | |
| callback(gpio, events); | |
| } | |
| } |
Line 155 should be
callback(i, events);
Metadata
Metadata
Assignees
Labels
No labels