diff --git a/arch/arm/src/nrf52/nrf52_gpio.c b/arch/arm/src/nrf52/nrf52_gpio.c index 6aaff7fc9b..6f5625c532 100644 --- a/arch/arm/src/nrf52/nrf52_gpio.c +++ b/arch/arm/src/nrf52/nrf52_gpio.c @@ -184,7 +184,7 @@ static inline void nrf52_gpio_sense(nrf52_pinset_t cfgset, { regval |= GPIO_CNF_SENSE_HIGH; } - else + else if (mode == GPIO_SENSE_LOW) { regval |= GPIO_CNF_SENSE_LOW; } diff --git a/arch/arm/src/nrf52/nrf52_gpiote.c b/arch/arm/src/nrf52/nrf52_gpiote.c index 777b131adf..09fb743526 100644 --- a/arch/arm/src/nrf52/nrf52_gpiote.c +++ b/arch/arm/src/nrf52/nrf52_gpiote.c @@ -532,6 +532,14 @@ void nrf52_gpiote_set_task(uint32_t pinset, int channel, int nrf52_gpiote_init(void) { + /* Clear LATCH register(s) */ + + putreg32(0, NRF52_GPIO_P0_BASE + NRF52_GPIO_LATCH_OFFSET); + +#ifdef CONFIG_NRF52_HAVE_PORT1 + putreg32(0, NRF52_GPIO_P1_BASE + NRF52_GPIO_LATCH_OFFSET); +#endif + /* Reset GPIOTE data */ memset(&g_gpiote_ch_callbacks, 0, sizeof(g_gpiote_ch_callbacks));