Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs

Latch disabled GPIOTE interrupt?

Is it possible to disable a GPIOTE interrupt, while performing some processing, and latch any incoming interrupt while that processing is occurring, so it fires once the interrupt is reenabled?

My scenario, external SPI device receives some data, signals the nRF by an interrupt line, I want to disable the interrupt while I retrieve that data, if an interrupt occurs while I'm retrieving that data, I want to finish processing, reenable interrupts and then process go ahead and process it.

I tried nrfx_gpiote_in_event_disable but the interrupt is 'lost' as the interrupt is not latched while disabled.

Is this possible?

 

Parents Reply
  • Hi Einar,

    I've not explicitly enabled any latching - I was expecting the interrupt to be latched through the section of code while disabled.

    I have attached a project I put together to test the idea.

    Button 1 is set up with a gpiote handler to toggle LED1

    LED2 is toggled by a timer

    When LED2 is on, button 1 interrupt is disabled. when LED2 turns off, the interrupt is reenabled.

    What I want to happen:
    LED2 turns on, disables interrupt. I press Button 1, nothing happens, when LED2 turns off and reenables the interrupt, I then want the interrupt to fire, turning on LED 1.

    What happens is that LED 1 only turns on is Button 1 is pressed while LED2 is off.bsp_demo.zip

Children
Related