Jump to content
43oh

Basic Subroutines


Recommended Posts

I feel like an idiot asking this question. I had this program working on my msp430f2274. Now I am trying to play with it using CCSv5 and putting it on the launchpad. For some reason it is skipping over my subroutines.

 

#include 
#include 
//***********************************************************************
void delaySec(int n){
int i;
int j;
int k;
for (i=0;i		for (k=0;k<1000;k++){
		for (j=0;j<100;j++){
		;}
	}
}
}


void main(void) {
	WDTCTL = WDTPW + WDTHOLD; //disable watchdog
	delaySec(2);
	P1DIR = 0xFE; //set p1.6 as output,and P1.0 as input.
	P1OUT = 0x40; //p1.6 is pulled down
	while (1){
		delaySec(10);
		P1OUT = 0x00; //p1.6 is pulled up
		delaySec(10);
		P1OUT = 0x40; //p1.6 is pulled down
	}
}

 

Please don't make fun of my delay loops.

Link to post
Share on other sites
- Post a full test program.

- Are any optimizations turned on.

 

I just edited and added the #includes, with that it is my full test program.

 

I just installed CCSv5 on this computer today so all the defaults are intact. I went into project properties and looked at optimizations and it was at level 0. So I don't think so. Is that what you are talking about?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...