> -----Original Message-----
> From: [email protected]
[mailto:avr-chat-
> [email protected]] On Behalf Of Anthony
Andriano
> Sent: Sunday, January 29, 2012 6:55 PM
> To: Britton Kerin
> Cc: [email protected]
> Subject: Re: [avr-chat] portable no-op with AVR GCC, AVR LIbc?
> 
> There is also:
> 
> __builtin_avr_delay_cycles(unsigned long __n);


This is the preferred method.
 
> The compiler will delay exactly as many cycles as you provide with the
> argument by inserting useless, and more importantly harmless, code. I
usually
> see something like a string of subtracts, adds, etc.

It should be "NOP" or "RJMP ." (which delays 2 cycles but just jumps to
the next instruction), and then typically loops formed around those
instructions to delay to the exact number of cycles.

Eric Weddington

_______________________________________________
AVR-chat mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/avr-chat

Reply via email to