This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nrf9160 2 interrupts , one disble the other

Dear Sir.

I am using 2 interrupts 

void AFE4900_Interrupt_Config(void)
{

if(gpio_pin_configure(dev_io, AFE4900_INT_PIN, GPIO_INPUT | GPIO_INT_ENABLE | GPIO_INT_EDGE | GPIO_PULL_UP))
{
_ERROR_SM.e_error = err_io;
_ERROR_SM.e_num_major++;
}
gpio_init_callback(&gpio_cb, AFE4900_Interrupt, BIT(AFE4900_INT_PIN));
gpio_add_callback(dev_io, &gpio_cb);
gpio_pin_interrupt_configure(dev_io, AFE4900_INT_PIN, GPIO_INT_EDGE_TO_ACTIVE);
}

void LSM6DSL_Interrupt2_Config(void)
{
if(gpio_pin_configure(dev_io, LSM6DSL_INT2_PIN, GPIO_INPUT | GPIO_INT_ENABLE | GPIO_INT_EDGE | GPIO_PULL_UP))
{
_ERROR_SM.e_error = err_io;
_ERROR_SM.e_num_major++;
}
gpio_init_callback(&gpio_cb, LSM6DSL_Interrupt2, BIT(LSM6DSL_INT2_PIN));
gpio_add_callback(dev_io, &gpio_cb);
gpio_pin_interrupt_configure(dev_io, LSM6DSL_INT2_PIN, GPIO_INT_EDGE_RISING);
}

In Main 

case 1.

AFE4900_Interrupt_Config();
LSM6DSL_Interrupt2_Config();

In this case LSM6DSL_Interrupt2_Config disables AFE4900_Interrupt_Config .

case 2.

LSM6DSL_Interrupt2_Config();

AFE4900_Interrupt_Config();

In this case AFE4900_Interrupt_Config disables  LSM6DSL_Interrupt2_Config.

 

Please Advise

Parents Reply Children
No Data
Related