Skip to content

Commit

Permalink
Fix assert in gpio_set_irq_enabled
Browse files Browse the repository at this point in the history
The assert doesn't work properly for pins >= 32
  • Loading branch information
peterharperuk committed Aug 23, 2024
1 parent 7dc10d7 commit c5ef8ba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rp2_common/hardware_gpio/gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ void gpio_set_irq_enabled(uint gpio, uint32_t events, bool enabled) {
// or callback should already be set (raw or using gpio_set_irq_callback)
// this protects against enabling the interrupt without callback set
assert(!enabled
|| (raw_irq_mask[get_core_num()] & (1u<<gpio))
|| (raw_irq_mask[get_core_num()] & (1ULL<<gpio))
|| callbacks[get_core_num()]);

// Separate mask/force/status per-core, so check which core called, and
Expand Down

0 comments on commit c5ef8ba

Please sign in to comment.