Tool/software: TI C/C++ Compiler
Hello.
There are two different states for interrupt ISR jump.
Case1 (No jump) , Case2 (jump OK) , Why is it different ?
Is not it all the same in two cases ?
What's the difference?
thanks.
[ Case1 ]
void
PM0IntHandler(void)
{
ROM_IntMasterDisable();
GPIOIntClear(GPIO_PORTM_BASE, GPIO_PIN_0);
UARTprintf("GPIOM Falling_Edge Interrupt\n");
ROM_IntMasterEnable();
}
int
main(void)
{
// Enable GPIOG for the on-board LED.
// Enable GPIOM for the on-board Up Button.
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOG);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOM);
// GPIOG Port Pin2, Ouput Seting
GPIOPinTypeGPIOOutput(GPIO_PORTG_BASE, GPIO_PIN_2 );
// UART Func Call
ConfigureUART();
// No define System Clock
UARTprintf("CLOLK = %d\n",SysCtlClockGet());
// GPIO PM0 Pin Input Set
GPIOPinTypeGPIOInput(GPIO_PORTM_BASE, GPIO_PIN_0);
// GPIO Pad Config Set
GPIOPadConfigSet(GPIO_PORTM_BASE, GPIO_PIN_3|GPIO_PIN_2|GPIO_PIN_1|GPIO_PIN_0 ,
GPIO_STRENGTH_8MA,GPIO_PIN_TYPE_STD_WPU);
// GPIOM interrupt Type Seting ( GPIO_LOW_LEVEL or GPIO_FALLING_EDGE )
GPIOIntTypeSet(GPIO_PORTM_BASE, GPIO_PIN_0, GPIO_FALLING_EDGE);
// GPIOM Pin0, Interrupt handler Reigster
//GPIOIntRegister(GPIO_PORTM_BASE, PM0IntHandler);
// GPIOM Interrupt Enabel
GPIOIntEnable(GPIO_PORTM_BASE, GPIO_INT_PIN_0);
IntMasterEnable();
while(1)
{
// Turn on the LED.
GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_2, 0x04);
UARTprintf("LED On \n");
SysCtlDelay((SysCtlClockGet()/3)*0.1); //100ms Delay, (High)
// Turn off the LED.
GPIOPinWrite(GPIO_PORTG_BASE, GPIO_PIN_2, ~(0x04));
UARTprintf("LED Off\n");
SysCtlDelay((SysCtlClockGet()/3)*0.05); //50ms Delay, (Low)
UARTprintf(" \n");
}
}
startup_rvmdk.S for Keil
EXTERN PM0IntHandler
; The vector table
DCD PM0IntHandler ; GPIO Port M
.
.
.
[ Case 2]
// GPIOM Pin0, Interrupt handler Reigster
GPIOIntRegister(GPIO_PORTM_BASE, PM0IntHandler);
startup_rvmdk.S for Keil
; EXTERN PM0IntHandler
; The vector table
DCD IntDefaultHandler ; GPIO Port M
.
.
.