pio_set_irqn_source_mask_enabled() sets wrong irq (#655)

if irq_index == 0, irq_index evaluates to false; which uses pio_set_irq1_source_mask_enabled() ; and vice versa
This commit is contained in:
Maarten Vanraes 2021-11-12 14:51:29 +01:00 committed by GitHub
parent 699838d153
commit a8fa19a74d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -790,9 +790,9 @@ static inline void pio_set_irqn_source_enabled(PIO pio, uint irq_index, enum pio
static inline void pio_set_irqn_source_mask_enabled(PIO pio, uint irq_index, uint32_t source_mask, bool enabled) {
invalid_params_if(PIO, irq_index > 1);
if (irq_index) {
pio_set_irq0_source_mask_enabled(pio, source_mask, enabled);
} else {
pio_set_irq1_source_mask_enabled(pio, source_mask, enabled);
} else {
pio_set_irq0_source_mask_enabled(pio, source_mask, enabled);
}
}