fix incorrect assertions in hardware_pio (fixes #3035) #3036

Merged
headblockhead merged 1 commit from fix-hardware-pio-assertions into develop 2026-06-27 15:58:56 -05:00
headblockhead commented 2026-06-27 11:27:17 -05:00 (Migrated from github.com)

Two assertions in the hardware_pio library incorrectly allow invalid parameter values for irq_index: pio_set_irqn_source_enabled and pio_set_irqn_source_mask_enabled.
They are intended to accept only 0 or 1, however the assertion used unintentionally accepts a value of 2.
This pull request fixes this issue by checking for invalidity of the irq_index value through irq_index >= NUM_PIO_IRQS, rather than irq_index > NUM_PIO_IRQS, where NUM_PIO_IRQS is defined to the value of 2.

Fixes #3035.

Two assertions in the hardware_pio library incorrectly allow invalid parameter values for irq_index: `pio_set_irqn_source_enabled` and `pio_set_irqn_source_mask_enabled`. They are intended to accept only 0 or 1, however the assertion used unintentionally accepts a value of 2. This pull request fixes this issue by checking for invalidity of the `irq_index` value through `irq_index >= NUM_PIO_IRQS`, rather than `irq_index > NUM_PIO_IRQS`, where NUM_PIO_IRQS is defined to the value of 2. Fixes #3035.
kilograham (Migrated from github.com) approved these changes 2026-06-27 15:24:19 -05:00
Sign in to join this conversation.
No reviewers
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!3036
No description provided.