mirror of
https://github.com/micropython/micropython.git
synced 2025-07-21 13:01:10 +02:00
rp2/machine_pin: Generalise gpio_irq handler for pins >32.
Fix the gpio_irq function so that it looks at all six iobank0_hw->intr[n] registers, for up to 48 IOs. Signed-off-by: Phil Howard <phil@gadgetoid.com>
This commit is contained in:
committed by
Damien George
parent
733052f6b9
commit
57f4cabff9
@@ -86,6 +86,7 @@ typedef struct _machine_pin_irq_obj_t {
|
||||
} machine_pin_irq_obj_t;
|
||||
|
||||
static const mp_irq_methods_t machine_pin_irq_methods;
|
||||
static const int num_intr_regs = sizeof(iobank0_hw->intr) / sizeof(iobank0_hw->intr[0]);
|
||||
|
||||
// Mask with "1" indicating that the corresponding pin is in simulated open-drain mode.
|
||||
uint64_t machine_pin_open_drain_mask;
|
||||
@@ -99,7 +100,7 @@ static inline bool is_ext_pin(__unused const machine_pin_obj_t *self) {
|
||||
#endif
|
||||
|
||||
static void gpio_irq(void) {
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
for (int i = 0; i < num_intr_regs; ++i) {
|
||||
uint32_t intr = iobank0_hw->intr[i];
|
||||
if (intr) {
|
||||
for (int j = 0; j < 8; ++j) {
|
||||
|
Reference in New Issue
Block a user