Reputation: 10025
How do I do the opposite of this:
while((*i2s) & (1<<19))
usleep(10);
I want to keep sleeping while the 19th bit is 0.
Upvotes: 0
Views: 231
Reputation: 18550
Using the ! operator will negate your expression:
while(!((*i2s) & (1<<19)))
usleep(10);
Upvotes: 0
Reputation: 7638
!
not operator reverses a condition:
while(!((*i2s) & (1 << 19))) {
usleep(10);
}
Upvotes: 1
Reputation: 23321
To do the opposite of something, use !
while(!((*i2s) & (1<<19)))
usleep(10);
Upvotes: 0