
26 Jan
2011
26 Jan
'11
8:50 a.m.
Dear Lei Wen,
In message AANLkTin0HQKxKiLas8H4_GHmFsdi1Mt3gPbTK0A17r2d@mail.gmail.com you wrote:
while (loop--);
Please write:
while (loop--) ;
Fixed...
But then - are you sure the compiler does not optimize this out? You probably want to use __udelay() instead.
From the practice, we think this loop is enough to make timer stablize...
There is nothing in this code to prevent the cmpiler from optimizing this out.
You can as well delete these lines then.
If you need a delay, then you must do better.
Involve the __udelay() may not suitable for the timer functions...
Depends...
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"The pathology is to want control, not that you ever get it, because
of course you never do." - Gregory Bateson