On Fri, Sep 28, 2007 at 09:05:40AM -0500, David Kelly wrote:
> 
> For finer delays don't forget the OCR functions on the timers. Is pretty
> easy to write and create very accurate delays with:
> 
> void delay( uint8_t delay );
> {
>       OCR2A = TCNT2 + delay;
>       TIFR2 = (1<<OCF2A);             //  clear possible pending
> 
>       //  wait until TCNT2 matches OCR2A
>       while( ( TIFR2 && (1<<OCF2A) ) == 0 )
                       ^^ arrgh!

>               ;
> }

Above should be while( ( TIFR2 & (1<<OCF2A) ) == 0 ), bitwise and, not
logical and.

-- 
David Kelly N4HHE, [EMAIL PROTECTED]
========================================================================
Whom computers would destroy, they must first drive mad.


_______________________________________________
AVR-GCC-list mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to