while loop

Hello.
I would like for this while loop to wait for ADC_INT_STATUS bit in register ADC_INT_STATUS_REG to turn off and then proceed. Is this well written? Is there any better way?

unsigned int enable1;

while(enable1){
enable1 = ADC_INT_STATUS_REG & ADC_INT_STATUS;
}

I think you have to give more information on this. Like where the values of your variables are coming from. Prolly best to post your whole code or at least anything that is associated with this while loop.

From my understanding the expression that is in the parenthesis of the while loop is a basically a bool statement that makes the while loop continue till the expression is false. What you have written can not b false.

if you wrote

1
2
3
4
5
6
7
8
9
10
11
12
unsigned int enable1;

while(enable1 !=ADC_INT_STATUS_REG & ADC_INT_STATUS){
// Stuff to do here while enable 1 not = status reg & status
}
}(enable1)









here is lil snippet from the tutorial section of this site (people never seem to look there lol)

The while loop
Its format is:

while (expression) statement

and its functionality is simply to repeat statement while the condition set in expression is true.

Last edited on
If i do it like this i get a syntax error.
Topic archived. No new replies allowed.