Add irq_has_handler() and use it to fix GPIO IRQ assert #2277

Merged
kilograham merged 1 commit from gpio_assert into develop 2025-02-17 16:07:27 -06:00
kilograham commented 2025-02-16 12:43:18 -06:00 (Migrated from github.com)

fixes #2266

fixes #2266
Wren6991 (Migrated from github.com) reviewed 2025-02-16 12:43:18 -06:00
will-v-pi (Migrated from github.com) reviewed 2025-02-16 12:43:18 -06:00
peterharperuk (Migrated from github.com) reviewed 2025-02-17 11:15:20 -06:00
@ -201,3 +207,3 @@
check_irq_param(irq_num);
irq_handler_t handler = irq_get_vtable_handler(irq_num);
return handler && is_shared_irq_raw_handler(handler);
return is_shared_irq_raw_handler(handler);
peterharperuk (Migrated from github.com) commented 2025-02-17 11:15:20 -06:00

I don't quite get why you removed the check for handler != NULL

I don't quite get why you removed the check for handler != NULL
kilograham (Migrated from github.com) reviewed 2025-02-17 11:43:11 -06:00
@ -201,3 +207,3 @@
check_irq_param(irq_num);
irq_handler_t handler = irq_get_vtable_handler(irq_num);
return handler && is_shared_irq_raw_handler(handler);
return is_shared_irq_raw_handler(handler);
kilograham (Migrated from github.com) commented 2025-02-17 11:43:11 -06:00

Because is_shared_irq_raw_handler() returns false for NULL (I hope), and actually in any case NULL is not used for unused IRQs in the VTABLE anyway

Because is_shared_irq_raw_handler() returns false for NULL (I hope), and actually in any case NULL is not used for unused IRQs in the VTABLE anyway
kilograham (Migrated from github.com) reviewed 2025-02-17 11:43:32 -06:00
@ -201,3 +207,3 @@
check_irq_param(irq_num);
irq_handler_t handler = irq_get_vtable_handler(irq_num);
return handler && is_shared_irq_raw_handler(handler);
return is_shared_irq_raw_handler(handler);
kilograham (Migrated from github.com) commented 2025-02-17 11:43:32 -06:00

i just noticed it in passing

i just noticed it in passing
peterharperuk (Migrated from github.com) approved these changes 2025-02-17 13:55:36 -06:00
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
gh-raspberrypi/pico-sdk!2277
No description provided.