This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

switch problem

C51 version 7.09

a = LEFT ;
switch (a)
{ case LEFT : subproA		  		      P1 = 0x01;
	      P1 = 0x01;
	      subproA				      break;
  case RIGHT : subproB		  		      P1 = 0x01;
	      P1 = 0x01;
	      subproB				      break;
  default : somethingjob;
}	  				   
There is incorrect excution flow.
This action should go first line of case LEFT and excuted all comment, but it doesn't. after it go to first line of case LEFT, thenn it jump to other place,where is second line of case RIGHT to excution.
And it is like not going to default place after all case comment.

0