Hi,
I am trying to set up PP0 and PP1 to have internal pull up resistors, then I have a switch tied to them and ground, when I hit the switch, I would like my interrupt to be called, recognize which pin was called and light up a corresponding LED., when the button is released, the switch is no long in position and the corresponding LED should be turned off.
I set breakpoints in the interrupt handler, but it seems that the interrupt handler is never called. Any help would be appreciated
void LegacyPulseMode (void) { GPIOPinTypeGPIOInput(GPIO_PORTP_BASE, (GPIO_PIN_0 | GPIO_PIN_1)); GPIOPadConfigSet(GPIO_PORTP_BASE, (GPIO_PIN_0 | GPIO_PIN_1), GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); GPIOPinTypeGPIOOutput(GPIO_PORTP_BASE, GPIO_PIN_3 | GPIO_PIN_5); // PP3 = OUTPUT LED || PP5 = Enable LED GPIOIntTypeSet(GPIO_PORTP_BASE, (GPIO_PIN_0 | GPIO_PIN_1), GPIO_BOTH_EDGES); //Do not need discrete GPIOIntRegister(GPIO_PORTP_BASE, LegacyIntHandler); GPIOIntEnable(GPIO_PORTP_BASE, (GPIO_INT_PIN_0 | GPIO_INT_PIN_1 | GPIO_INT_PIN_2 | GPIO_INT_PIN_3 | GPIO_INT_PIN_4 | GPIO_INT_PIN_5 | GPIO_INT_PIN_6 | GPIO_INT_PIN_7)); IntEnable(INT_GPIOP0); IntDisable((INT_GPIOP1 | INT_GPIOP2 | INT_GPIOP3 | INT_GPIOP4 | INT_GPIOP5 | INT_GPIOP6 | INT_GPIOP7)); } // PP5 is tied to PP0 // PP3 is tied to PP1 void LegacyIntHandler (void) { uint32_t status = 0; uint32_t read0 = 0, read1 = 0, read2=0; status = GPIOIntStatus(GPIO_PORTP_BASE, true); GPIOIntClear(GPIO_PORTP_BASE, status); read0 = GPIOPinRead(GPIO_PORTP_BASE, GPIO_PIN_0); read1 = GPIOPinRead(GPIO_PORTP_BASE, GPIO_PIN_1); // read2 = GPIOPinRead(GPIO_PORTP_BASE, GPIO_PIN_2); if(read0 == 0) { GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, GPIO_PIN_5); } else if(read0 == GPIO_PIN_0) { GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_5, 0x0); } if(read1 == 0) { GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_3, GPIO_PIN_3); } else if(read1 == GPIO_PIN_1) { GPIOPinWrite(GPIO_PORTP_BASE, GPIO_PIN_3, 0x0); } }