Jun 11, 2019
11:30 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2019
11:30 AM
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.
Solved! Go to Solution.
Labels
- Labels:
-
PSoC Creator Software
1 Solution
Jun 11, 2019
11:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2019
11:54 AM
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
2 Replies
Jun 11, 2019
11:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2019
11:54 AM
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
Jun 11, 2019
11:57 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2019
11:57 AM
Thank you Bob