AnsweredAssumed Answered

GPIO interrupt triggers only once

Question asked by Michel Hayoz on Aug 10, 2017
Latest reply on Aug 18, 2017 by Daniel Chen

Dear all

 

The ISR of a gpio interrupt triggers only once. I cleared the interrupt flag in the ISR and the interrupts are not disabled anywhere in the code. Does anyone how I can solve that issue? (I am using MQX 4.2 and the Vybrid VF61 Cortex M4)

 

Interrupt initialisation:

void gpio_init(void)

{

   static LWGPIO_STRUCT temp_gpio;

   lwgpio_init(&temp_gpio, LWGPIO_PTE14, LWGPIO_DIR_INPUT, LWGPIO_VALUE_NOCHANGE);  
    lwgpio_set_functionality(&temp_gpio, 1);   /*sets the gpio mux to gpio setting*/

   lwgpio_set_attribute(&temp_gpio,  LWGPIO_ATTR_OPEN_DRAIN, LWGPIO_AVAL_ENABLE); 

   lwgpio_int_init(&temp_gpio, LWGPIO_INT_MODE_FALLING );

    _int_install_isr(lwgpio_int_get_vector(&temp_gpio), portE_int_handler , (void *)&temp_gpio);

    _bsp_int_init(lwgpio_int_get_vector(&temp_gpio), 3, 0, TRUE);  /*initialize the interrupt and set its priority.  */
    lwgpio_int_enable(&temp_gpio, TRUE);  /*enable the interrupt for use*/

}

 

ISR:

static void portE_int_handler(void *pin)
{
     printf("interrupt happened\n");
     lwgpio_int_clear_flag((LWGPIO_STRUCT_PTR) pin); 
}

Outcomes