I am developing a product that I have going into SYSTEM_SOFT_OFF to maximise battery life. I have a bunch of GPIOs (these are currently just buttons on the nRF52-DK) that I use to trigger the hardware out of this mode, and start up. I then check the registers to see which GPIO caused the exit, and process this accordingly.
I get the reset reason and check the GPIO registers using the following.
reset_reason = NRF_POWER->RESETREAS; gpio_trigger = NRF_GPIO->LATCH;
That all seems to work well. But I am finding that if I press one of the buttons twice in quick succession (so, < 0.5 sec between presses), I get the firmware exiting SYSTEM_SOFT_OFF twice, but in neither instance does it actually successfully register which GPIO caused the exit.
So, I want to be able to disable the GPIO from triggering a subsequent software reset whilst I'm processing the current one, but can't seem to work out how to get that done.
I tried calling this API to disable the GPIO interrupt function as one of the first things I do in my main.c
nrf_gpio_cfg_sense_input(sml_strike.pin, NRF_GPIO_PIN_PULLUP, NRF_GPIO_PIN_NOSENSE);
But that doesn't seem to do what I want it to.
Any ideas?
Cheers,
Mike