So I've been noticing that my Stellaris Launchpad does not seem to properly load a program onto it. I would turn the power off and when I restart it the program I had on there was no longer running. I decided to step through my program and I noticed that when It ran the interrupt enable command my debugger would stop, I could no longer move forward or back just pause. Below I've pasted all of the code pertaining to the interrupt in both the main file and startup_ccs.c Also appalogies I'm not sure how to paste in code in this forum I don't see anything on it.
Main: (Outside of the main loop)
void onBoardInteruptHandle(void){
long tmp = GPIOPinRead(GPIO_PORTF_BASE,GPIO_PIN_0|GPIO_PIN_4);
if(tmp==0x00){ //Both buttons pressed
if(asleep){
//SysCtlReset();
}else{
asleep=1; //Right now it doesn't actually stay asleep, I'm not sure what is happening really it could be resetting to quickly or just never really sleep
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3,0x00); //Blue
//SysCtlSleep();
}
}else if(tmp==0x01){ //Sw1 pressed
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3,0x02); //Red
}else if(tmp==0x10){ //Sw2 pressed
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3,0x04); //Blue
}else{ //Nothing pressed
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3,0x08); //Green
}
//GPIOPinIntClear(GPIO_PORTF_BASE,GPIO_PIN_0|GPIO_PIN_4); //This turns off the interrupt do not uncomment
}
Main:(Inside loop)
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3); //RGB LED's
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1|GPIO_PIN_2|GPIO_PIN_3,0x00);
HWREG(GPIO_PORTF_BASE + GPIO_O_LOCK) = GPIO_LOCK_KEY_DD; //Sw1 (PF4) is unaviable unless you make it only a GPIOF input via these commands
HWREG(GPIO_PORTF_BASE + GPIO_O_CR) = 0x1;
GPIOPinTypeGPIOInput(GPIO_PORTF_BASE,GPIO_PIN_0|GPIO_PIN_4); //Onboard buttons (PF0=Sw2,PF4=Sw1
GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_0|GPIO_PIN_4, GPIO_STRENGTH_2MA,GPIO_PIN_TYPE_STD_WPU);
IntMasterEnable();
IntEnable(INT_GPIOF);
Startup_ccs.c:
extern void onBoardInteruptHandle(void);
onBoardInteruptHandle, // GPIO Port F
I also used to load my interrupt handler using GPIOPortIntRegister but I found this way to do it and it appeared to look much cleaner.
Note my program does not run through that specific command if I try that idea instead. Also If I hit pause when the program freezes up it is somewhere inside of my interrupt handler I try to step through again when I get an error looking for the interrupt.c file. I found the file for my program and now it moves to the very next command I hit run it freezes again. I hit pause and once again it is inside of my interrupt handler. It loops through this one command over and over. Is there some reason stating I can't have an interrupt when I'm debugging because, as far as I know there is no way to load a program to the Stellaris other than hitting debug and then run.
Sorry if this question is poorly written and thank you for any help you can provide this is very confusing and keeping me from continuing.