Part Number: TM4C129ENCPDT
Hello,
I have two Interrupts setup on PD2 and PD3 pins. However the firmware will always jump to PD3 (PS_RESET_REQ_PIN) ISR.
Here is my initialization for the two pins.
//PD2 Pin = PS_ONOFF_REQ_PIN
void PS_ONOFF_Req_interrupt_enable(void)
{
ROM_GPIOPinTypeGPIOInput(PS_PORT2, PS_ONOFF_REQ_PIN);
IntMasterDisable();
GPIOPinTypeGPIOInput(PS_PORT2, PS_ONOFF_REQ_PIN);
GPIOPadConfigSet(PS_PORT2, PS_ONOFF_REQ_PIN, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); // Enable weak pullup resistor for ADC_BUSY
GPIOIntDisable(PS_PORT2, PS_ONOFF_REQ_PIN); // Disable interrupt for ADC_BUSY (in case it was enabled)
GPIOIntClear(PS_PORT2, PS_ONOFF_REQ_PIN); // Clear pending interrupts for ADC_BUSY
GPIOIntRegister(PS_PORT2, PSONOFFReqIntHandler);
GPIOIntTypeSet(PS_PORT2, PS_ONOFF_REQ_PIN, GPIO_FALLING_EDGE); // Configure for Rising and Falling Edge
GPIOIntEnable(PS_PORT2, PS_ONOFF_REQ_PIN); // Enable interrupt for ADC_BUSY
IntMasterEnable();
}
//PD3 Pin = PS_RESET_REQ_PIN
void PS_LocalReset_Req_interrupt_enable(void)
{
IntMasterDisable();
ROM_GPIOPinTypeGPIOInput(PS_PORT2, PS_RESET_REQ_PIN);
GPIOPinTypeGPIOInput(PS_PORT2, PS_RESET_REQ_PIN);
GPIOPadConfigSet(PS_PORT2, PS_RESET_REQ_PIN, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU); // Enable weak pullup resistor for ADC_BUSY
GPIOIntDisable(PS_PORT2, PS_RESET_REQ_PIN); // Disable interrupt for ADC_BUSY (in case it was enabled)
GPIOIntClear(PS_PORT2, PS_RESET_REQ_PIN); // Clear pending interrupts for ADC_BUSY
GPIOIntRegister(PS_PORT2, PSResetReqIntHandler);
GPIOIntTypeSet(PS_PORT2, PS_RESET_REQ_PIN, GPIO_FALLING_EDGE); // Configure for Rising and Falling Edge
GPIOIntEnable(PS_PORT2, PS_RESET_REQ_PIN); // Enable interrupt for ADC_BUSY
IntMasterEnable();
}
and here is the ISR interrupt Handler for both interrupts;
//Interrupt handler for PD3 (PS_RESET_REQ_PIN)
void PSResetReqIntHandler(void)
{
GPIOIntClear(PS_PORT2, PS_RESET_REQ_PIN);
UARTprintf("\r\nLocal Reset button pressed");
}
//Interrupt handler for PD2 (PS_ONOFF_REQ_PIN)
void PSONOFFReqIntHandler(void)
{
GPIOIntClear(PS_PORT2, PS_ONOFF_REQ_PIN);
UARTprintf("\r\nLocal On button pressed");
}
Any idea ?
Thanks