This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

External Interrupt using switch

I'm new to LM4F120H5QR. I'm trying to generate an interrupt externally using a switch, but am not being able to do so.

This is a part of the code that i wrote for it.

void GPIOPortF_Handler(void)

{

blinky();//this blinks the blue led once

{

void int_init()

{ SYSCTL_RCGC2_R |= SYSCTL_RCGC2_GPIOF;
GPIO_PORTF_DIR_R &= ~0x10; // (c) make PF4 in (built-in button)
GPIO_PORTF_AFSEL_R &= ~0x10; // disable alt funct on PF4
GPIO_PORTF_DEN_R |= 0x10; // enable digital I/O on PF4
// configure PF4 as GPIO
GPIO_PORTF_PCTL_R = (GPIO_PORTF_PCTL_R&0xFFF0FFFF)+0x00000000;
GPIO_PORTF_AMSEL_R = 0; // disable analog functionality on PF
GPIO_PORTF_PUR_R |= 0x10; // enable weak pull-up on PF4
GPIO_PORTF_IS_R &= ~0x10; //  PF4 is edge-sensitive
GPIO_PORTF_IBE_R &= ~0x10; // PF4 is not both edges
GPIO_PORTF_IEV_R &= ~0x10; // PF4 falling edge event
GPIO_PORTF_IM_R |= 0x10;
NVIC_EN0_R = NVIC_EN0_INT30;

}

int main(void){
int_init();

while(1){

}
}

Please help.

If anyone could provide a working code with comments it would help me to understand much better. thanks