lpcware

while(1) not eternal

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by Brinkand on Thu Feb 25 07:24:41 MST 2010
This keeps bugging me:

 

ADC_local_counter = 0;
  

  while(1)
  {ADC_local_counter++; };


[COLOR=black][FONT=&quot]ADC_local_counter ends at 1! I would suspect it to keep incrementing during execution, but it only runs once. Any hints?
[/FONT][/COLOR]
 


Below example works as expected:

[COLOR=black][FONT=&quot]
[/FONT][/COLOR]
ADC_local_counter = 0;
    
  while(ADC_local_counter <100)
  {ADC_local_counter++; };
  
    ADC_local_counter++;
 
ADC_local_counter ends at 101 as expected.

Outcomes