I ´m testing gpiote interrupt, i´m work with nrf51-dk, softdevice S110 and sdk 9.0.0.
I have a pin that receives a signal 0 all time, and it changes to 1 when I have to do some tasks, I declared pin as input, in init I say the configuracion of the interrupt, priority.
The thing is that I have a function that it makes a large amount of calculations, if I comment this fuction, i have 500 interrupts that are i have to receive but if i discomment function, the interrupt is about 250 and i don´t know why because I set priority to highest.
handler
void controlador_evento_interrupcion(nrf_drv_gpiote_pin_t pin, nrf_gpiote_polarity_t action){
lecturas++;
}
init
void interrupt_pin_inicio(){
uint32_t err_code;
nrf_drv_gpiote_in_config_t configuracion;
configuracion.is_watcher = false;
configuracion.hi_accuracy = true;
configuracion.pull = NRF_GPIO_PIN_PULLUP;
configuracion.sense = NRF_GPIOTE_POLARITY_LOTOHI;
NVIC_EnableIRQ(GPIOTE_IRQn);
NVIC_SetPriority(GPIOTE_IRQn, 1);
err_code = nrf_drv_gpiote_init();
//printf("Error: %zu ", err_code);
err_code = nrf_drv_gpiote_in_init(pin_interrupcion_lectura, &configuracion, controlador_evento_interrupcion);
//printf("Error: %zu ", err_code);
nrf_drv_gpiote_in_event_enable(pin_interrupcion_lectura , true);
//printf("Error: %zu ", err_code);
}
main declaration
nrf_gpio_cfg_input(pin_interrupcion_lectura, NRF_GPIO_PIN_PULLUP);
Thank you.