two interupts on same gpiote with two different pins nrf5340

hello,

i am using sdk 2.4.0 with nrf5340 i want to enable two diffferents buttons with interupts without disabling the one interupt because i need these two button for different scenario i cant basically trun off one interupt while using other 

/* API Prototypes */
void gpio_init()
{

	nrfx_err_t err;

	// Connect GPIOTE_0 IRQ to nrfx_gpiote_irq_handler 
	IRQ_CONNECT(DT_IRQN(DT_NODELABEL(gpiote)),
				DT_IRQ(DT_NODELABEL(gpiote), priority),
				nrfx_isr, nrfx_gpiote_irq_handler, 0);



	err = nrfx_gpiote_init(0);
	if (err != NRFX_SUCCESS)
	{
		// LOG_ERR("nrfx_gpiote_init error: %08x", err);
		return;
	}
nrfx_gpiote_in_config_t const mode_in_config = {
		.sense = NRF_GPIOTE_POLARITY_HITOLO,
		.pull = NRF_GPIO_PIN_NOPULL,
		.is_watcher = false,
		.hi_accuracy = true,
		.skip_gpio_setup = false,
	};

	nrfx_gpiote_in_config_t const in_config = {
		.sense = NRF_GPIOTE_POLARITY_HITOLO,
		.pull = NRF_GPIO_PIN_NOPULL,
		.is_watcher = false,
		.hi_accuracy = true,
		.skip_gpio_setup = false,
	};

	
/*	err = nrfx_gpiote_in_init(BUTTON_1_Pin, &mode_in_config, mode_button_handler);
	if (err != NRFX_SUCCESS)
	{
		 printf("nrfx_gpiote_in_init error 111111: %08x", err);
		return;
	}
	nrfx_gpiote_in_event_enable(BUTTON_1_Pin, true);*/
		err = nrfx_gpiote_in_init(BUTTON_2_Pin, &in_config, button_handler);
	if (err != NRFX_SUCCESS)
	{
		 printf("nrfx_gpiote_in_init error 2222222: %08x", err);
		return;
	}

nrfx_gpiote_in_event_enable(BUTTON_2_Pin, true);
	
	
}

i am getting error nrfx_gpiote_in_init error: 0bad0002 while initilaising second interupt

regards

manikandan 

Parents Reply Children
No Data
Related