X2.6 My cheat sheet for  programming MSP430 in C language.

 
  do, while


 while(1)  { P1OUT ^= 0x01; c++;}
 while ( i < max_count )  P1OUT ^= BIT0;

while(((k<j) && (run_flag) {}
while(((a==0) || (g>100) {}

while (!(ADC10IFG & ADC10CTL0));
while (ADC10CTL1 & ADC10BUSY);

while (CCR0 != TAR) CCR0 = TAR;

while (a != count)  
{ dataspace[a] = 0; a--; }

do
{ dataspace[a] = 0; a--; }
while (a != count);



P.S.  Just do not use single = to compare values!








16.02.2020  SKootS

_

 
 

Make a free website with Yola