PWM_ReadStatusRegister()

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
DaCh_4286001
Level 3
Level 3
First like received First like given

What's the difference between these 2 routine?

1. int a = 0;

    a = PWM_ReadStatusRegister();

    while((a & PWM_STATUS_CMP1) == 0);

2. while((PWM_ReadStatusRegister() & PWM_STATUS_CMP1) == 0);

the first one will stuck in while loop while the second one can pass while loop.

0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In the first (stuck) while-loop the variable a never gets updated.

PWM_STATUS_CMP1 is a bit-mask and does not change ether.

Bob

View solution in original post

0 Likes
2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

In the first (stuck) while-loop the variable a never gets updated.

PWM_STATUS_CMP1 is a bit-mask and does not change ether.

Bob

0 Likes

Thank you Bob

0 Likes