gpio: legacy level interrupt disable API not backwards compatible #22660
Labels
area: API
Changes to public APIs
area: Documentation
area: GPIO
bug
The issue is a bug, or the PR is fixing a bug
priority: low
Low impact/importance bug
Milestone
The following was discovered in testing and development of #22659:
In the old GPIO API interrupt configuration was integrated with pin configuration, so an interrupt could be enabled with:
and disabled within the callback with the idiom:
which, because it did not include any interrupt-related flags, was interpreted to mean disable interrupts.
In the new API interrupt configuration is done with the
gpio_pin_interrupt_configure()
function. The disable flag is a non-zero value distinct from the non-zero enable flag. For legacy compatibilitygpio_pin_configure()
extracts interrupt-related flags from its flags parameter and invokesgpio_pin_interrupt_configure()
with them, which means the legacy enable command works.However, the legacy disable command has no interrupt-related flags, which means the new implementation of
gio_pin_configure()
leaves interrupts enabled.In the case of level-triggered interrupts where the legacy disable operation is invoked in the callback the application will hang unless
GPIO_INT_DISABLE
is added to the flags.The text was updated successfully, but these errors were encountered: