I'm using the DK-TM4C129x Connected Development Board and would like to test the GPIO interrupt function using the User Input Switch SW4/Select as the interrupt signal. The code is below, but I can't get the interrupt to fire. All the examples use either Port A (summary interrupt) or don't provide the entire sequence. What is wrong with this?
Thank you very much for the help.
Evelyn
void PP1_IntHandler (void) {
// Clear the asserted interrupt.
GPIOIntClear(GPIO_PORTP_BASE, GPIO_PIN_1);
}
void Enable_PP1_Interrupt (void) {
// register the Handler
GPIOIntRegister(GPIO_PORTP_BASE, PP1_IntHandler);
// Enable the peripheral
SysCtlPeripheralEnable (SYSCTL_PERIPH_GPIOP);
// Set up the pin as an input
GPIOPinTypeGPIOInput(GPIO_PORTP_BASE, GPIO_PIN_1);
// Configure the weak pull up
GPIOPadConfigSet (GPIO_PORTP_BASE, GPIO_PIN_1,
GPIO_STRENGTH_2MA,
GPIO_PIN_TYPE_STD_WPU);
GPIOIntTypeSet(GPIO_PORTP_BASE, GPIO_PIN_1, (GPIO_FALLING_EDGE | GPIO_DISCRETE_INT));
GPIOIntEnable(GPIO_PORTP_BASE, GPIO_PIN_1);
GPIOIntClear(GPIO_PORTP_BASE, GPIO_PIN_1);
}