OK, I give up. I've been working this problem on-and-off all week.
I'm leaning Code Composer Studio and FreeRTOS. I'm going through the FreeRTOS "A practical guide". But I'm not sure if ether that is my problem. I started out writing some code to learn passing semaphores. I wrote an interrupt ISR and handler, but the ISR kept firing constantly, so I took out the semaphore and remarked out the handler. So not it's just an ISR that increments and global variable. But the ISR still keeps firing constantly. I'm using the $12 launch pad board and the ISR is coded to fire when switch number 1 is pressed. But it still fires all the time.
This is the set up code for the ISR:
//
//Enable the GPIO port F for LEDs.
ROM_SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF); //Enable the GPIO port F.
ROM_GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED); //Port F for output. Pin 1 is red LED, pin 2 is blue LED, pin 3 is green LED.
ROM_GPIOPinWrite(GPIO_PORTF_BASE, RED_LED|BLUE_LED|GREEN_LED, false); //Clear LEDs.
// ROM_GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_4); //Port F pin 4 for input.
ROM_GPIODirModeSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_DIR_MODE_IN);
ROM_GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
ROM_GPIOIntTypeSet(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_FALLING_EDGE);
ROM_IntPrioritySet(INT_GPIOF_TM4C123, 0x40); //Set to interupt priority 2. 1 is higher then 2.
// ROM_IntPrioritySet(INT_GPIOF, 0x20); //Set to interupt priority 1. 1 is higher then 2.
GPIOIntEnable(GPIO_PORTF_BASE, GPIO_INT_PIN_4);
ROM_IntEnable(INT_GPIOF_TM4C123);
// ROM_IntEnable(INT_GPIOF);
This is the ISR code:
//*****************************************************************************
//
// ISR for switch 1
//
//*****************************************************************************
void ISR_Switch1(void)
{
// while(1);
/*
portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE;
xSemaphoreGiveFromISR(SwitchISRSemaphore, &xHigherPriorityTaskWoken);
portEND_SWITCHING_ISR(xHigherPriorityTaskWoken);
*/
ROM_GPIOPinWrite(GPIO_PORTF_BASE, RED_LED, RED_LED); //Turn on red LEDClear LEDs.
ROM_SysCtlDelay(10000); //SysCtlDelayDelay loop takes 3 cycles per loop.
ROM_GPIOPinWrite(GPIO_PORTF_BASE, RED_LED, false); //Clear LEDs.
// redLEDdelay = redLEDdelay + 1000;
}