gpio: avoid disabling interrupts when supporting legacy code

gpio_pin_interrupt_configure() is invoked from within
gpio_pin_configure() to support legacy code that combines pin and
interrupt configuration.  Expressing a disabled interrupt by a zero
value for interrupt flags causes this invocation to disable interrupts
when the intent is to change only a pin configuration, such as pull
direction.

Support a distinction between explicitly disabling interrupts and
leaving the interrupt configuration unchanged.

Signed-off-by: Peter Bigot <peter.bigot@nordicsemi.no>
This commit is contained in:
Peter Bigot 2019-10-02 11:58:22 -05:00 committed by Carles Cufí
commit 2b150bff4f
2 changed files with 21 additions and 13 deletions

View file

@ -84,8 +84,8 @@
#define GPIO_DIR_OUT (1 << 9) /* GPIO_OUTPUT */
#define GPIO_PUD_PULL_UP GPIO_PULL_UP
#define GPIO_PUD_PULL_DOWN GPIO_PULL_DOWN
#define GPIO_INT_ACTIVE_LOW (1 << 15) /* GPIO_INT_LOW_0 */
#define GPIO_INT_ACTIVE_HIGH (1 << 16) /* GPIO_INT_HIGH_1 */
#define GPIO_INT_ACTIVE_LOW (1 << 16) /* GPIO_INT_LOW_0 */
#define GPIO_INT_ACTIVE_HIGH (1 << 17) /* GPIO_INT_HIGH_1 */
/** @endcond */
/**