Hi.
My Interrupt Service Routine for GPIO Pin Read Doesn't store the status of Pin Interrupt in "teed" Variable
Code:
ISR for GPIO Pin 4
void
GPIOIntHandler(void)
{
unsigned int teed;
teed = GPIOIntStatus(GPIO_PORTF_BASE, 1); //Unable to store the value of status register.Error:undefined value
GPIOIntClear(GPIO_PORTF_BASE , GPIO_PIN_4);
}
int
main(void)
{
.....
......
GPIOIntEnable(GPIO_PORTF_BASE , GPIO_PIN_4);
GPIOIntTypeSet(GPIO_PORTF_BASE , GPIO_PIN_4 , GPIO_BOTH_EDGES);
IntMasterEnable();
GPIOIntRegister(GPIO_PORTF_BASE , GPIOIntHandler);
while(1)
{
if( (GPIOPinRead(GPIO_PORTF_BASE, s1) == s1)) // Read if Pin is High
{
GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, RED_LED);
}
else // Read if Pin is Low(Button Pressed)
{
GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, GREEN_LED);
}
}
}
ISR Working Fine on pin press