Tool/software: Starterware
Hello,
I've have been working on my TIVAC-1294xl launchpad. I've used the timer interrupts and want to explore the interrupts for switch.
I did the following steps.
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOJ); GPIODirModeSet(GPIO_PORTJ_BASE, GPIO_PIN_0, GPIO_DIR_MODE_IN); GPIOPadConfigSet(GPIO_PORTJ_BASE, GPIO_PIN_0, GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU); /// FOR switch 1 IntMasterEnable(); IntEnable(INT_GPIOJ);
In the startup file i defined a function buttonpress at place of GPIO PORT J and also defined the extern function as void buttonpress(void);
Now in main.c i have the following code.
void buttonpress(void) { if(GPIOPinRead(GPIO_PORTJ_BASE, GPIO_PIN_0) == 0) { // blink an LED for for debugging } }
Can someone explain me the correct flow for switch interrupts?