Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

Optimization Problem

$
0
0

Hello,

 

I have a problem with optimization. Can anyone help me?

 

my code is below which is for loop and delaying.

 

volatile unsigned int b;
 
b = 30000;
do
{
b--;
}while(b != 0);
 
normally unless I define b as a volatile variable, it doesnt work, Can anyone explain why it doesnt work?
 
Also when I debug step by step, It works. Also without this loop it works but I can not see the changes.
 
Thanks

Viewing all articles
Browse latest Browse all 2077

Trending Articles