[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?
From: |
Weddington, Eric |
Subject: |
RE: [avr-gcc-list] How to force GCC to not to remove "nop" statements ? |
Date: |
Thu, 19 Feb 2009 11:14:40 -0700 |
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of Vincent Trouilliez
> Sent: Thursday, February 19, 2009 11:02 AM
> To: address@hidden
> Subject: [avr-gcc-list] How to force GCC to not to remove
> "nop" statements ?
>
> Hi list,
>
> Like many people I guess, I am using in-lined "nop" asm statements to
> respect the timing of external devices, when toggling their control
> lines.
>
<snip>
> Am using avr-gcc 4.3.2
>
If you are using WinAVR 20081205 then you can use one of the new builtin
functions:
void __builtin_avr_delay_cycles(unsigned long __n);
The prototype can be found in <avr/builtins.h>, but you shouldn't need the
prototype to call it.
The parameter is expecting the number of cycles that you want to delay, so in
your case this should be:
__builtin_avr_delay_cycles(4);
And then let gcc handle generating the code for you. ;-)
Eric Weddington
- [avr-gcc-list] How to force GCC to not to remove "nop" statements ?, Vincent Trouilliez, 2009/02/19
- RE: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?,
Weddington, Eric <=
- Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?, Vincent Trouilliez, 2009/02/19
- Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements ?, David Kelly, 2009/02/19
- RE: [avr-gcc-list] How to force GCC to not to remove "nop" statements?, Weddington, Eric, 2009/02/19
- Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements?, David Kelly, 2009/02/19
- Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements?, Jim Brain, 2009/02/19
- Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements?, David Kelly, 2009/02/19
- [avr-gcc-list] Preferred ICE (was: How to force GCC to not to remove "nop" statements?), Graham Davies, 2009/02/19
- Re: [avr-gcc-list] Preferred ICE (was: How to force GCC to not to remove "nop" statements?), David Kelly, 2009/02/20
- Re: [avr-gcc-list] How to force GCC to not to remove "nop" statements?, Joerg Wunsch, 2009/02/20