Is there any possibility to detect active state on the more than one pin using sense mechanism? GPIOTE_IRQHandler is blocked when it detect active state on the one of the used pins. How to deal with it?
Is there any possibility to detect active state on the more than one pin using sense mechanism? GPIOTE_IRQHandler is blocked when it detect active state on the one of the used pins. How to deal with it?
It's not clear for me. Could you modify example code in attached file?
void GPIOTE_IRQHandler(void)
{
if ((NRF_GPIOTE->EVENTS_PORT != 0) && (NRF_GPIOTE->INTENSET & GPIOTE_INTENSET_PORT_Msk))
{
NRF_GPIOTE->EVENTS_PORT = 0;
if(nrf_gpio_pin_read(PIN_1)==1)
{
flag_1=true;
}
if(nrf_gpio_pin_read(PIN_2)==1)
{
flag_2=true;
}
if(nrf_gpio_pin_read(PIN_3)==1)
{
flag_3=true;
}
}
}
Hi,
You are doing this correct. You are reading which pin is active when the interrupt is triggered. An easier way is to read the GPIO IN register directly instead of reading one and one pin, and see which pins are active: uint32_t active_pins = NRF_GPIO->IN; if (active_pins & my_bitmask_button_2) do_something();
Hi,
You are doing this correct. You are reading which pin is active when the interrupt is triggered. An easier way is to read the GPIO IN register directly instead of reading one and one pin, and see which pins are active: uint32_t active_pins = NRF_GPIO->IN; if (active_pins & my_bitmask_button_2) do_something();