On Thu, Dec 08, 2005 at 12:29:56PM +0000, Sumeet Pal Singh wrote: > Date: Thu, 8 Dec 2005 12:29:56 +0000 > From: Sumeet Pal Singh <[EMAIL PROTECTED]> > Subject: Re: [avr-gcc-list] (Newbie)2.Delay function not working as required > > The delay function is the regular one from <avr/delay.h> > I havce not written the delay. > > the thing is that > delayma(100); > delayma(100); > //Write this 100 times > gives a delay of 100*100ms. > > but > > for(char i=0;i<100;i++) > delayma(100); > > does not, that is where the problem is coming.
I think that compiler optimize your cycle away, since variable i is not used in its body. Whether turn off optimization or use application note avr133 aproach. Try to check with "avr-objdump -h -S program.elf" to see what is actually happening. Best wishes -- Alexei Chetroi Smile... Tomorrow will be worse. (c) Murphy's Law _______________________________________________ AVR-GCC-list mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/avr-gcc-list
