HI, I am new to embedded system and just start to learn NRF52 DK. currently I want to configure a pin of nrf52 as interrupt. so i created new GPIOTE_Handler function . however, it seems the function is multiply defined with a same function in drv_gpiote.c. after delete the function in drv_gpiote.c, the button function can't work properly. so i tried to merge the two GPIOTE_handler, but failed.
void GPIOTE_INIT(void){
nrf_gpio_cfg_input(31, GPIO_PIN_CNF_PULL_Pullup); //configure pin0.31 as gpio interrupt
NVIC_EnableIRQ(GPIOTE_IRQn);
NRF_GPIOTE->CONFIG[0] = (GPIOTE_CONFIG_POLARITY_HiToLo << GPIOTE_CONFIG_POLARITY_Pos)
| (31 << GPIOTE_CONFIG_PSEL_Pos)
| (GPIOTE_CONFIG_MODE_Event << GPIOTE_CONFIG_MODE_Pos);
NRF_GPIOTE->INTENSET = GPIOTE_INTENSET_IN0_Set << GPIOTE_INTENSET_IN0_Pos;
}
my GPIOTE_IRQHandler.
void GPIOTE_IRQHandler(void){
if ((NRF_GPIOTE->EVENTS_IN[0] == 1) && (NRF_GPIOTE->INTENSET & GPIOTE_INTENSET_IN0_Msk))
{
NRF_GPIOTE->EVENTS_IN[0] = 0;
DRDY = 1;
}
}
is anyone able to teach me to merge them. Thank you very much