[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?
From: |
Erik Christiansen |
Subject: |
Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why? |
Date: |
Wed, 28 Oct 2009 23:29:59 +1100 |
User-agent: |
Mutt/1.5.15+20070412 (2007-04-11) |
On Wed, Oct 28, 2009 at 12:44:48PM +0100, Joerg Desch wrote:
> I've talked to an colleague this morning. He had the same problems with
> WinAVR a few months ago. His solution was adding a asm volatile("nop")
> between cbi() and sbi(). He had to generate a bus timing by software.
When generating output pulses of only a few cpu cycles, I've always
preferred to do it in an asm file, linked in with the rest of the code.
That does cost a function call and return, but the timing cannot be
changed by gcc or command-line option vagaries. (In an embedded system,
protection against experiences like yours is why I don't like to leave
such critical things in the hands of compiler coders. YMMV, however.)
Erik
P.S. If this somehow doesn't make it to the list, could you please
forward it?
- [avr-gcc-list] optimizer removes volatile pin access code. why?, Joerg Desch, 2009/10/27
- Re: [avr-gcc-list] optimizer removes volatile pin access code. why?, Joerg Wunsch, 2009/10/27
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Joerg Desch, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Joerg Desch, 2009/10/28
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?,
Erik Christiansen <=
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Joerg Desch, 2009/10/31
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Erik Christiansen, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/28
- RE: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Stu Bell, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/29
- RE: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Stu Bell, 2009/10/30
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, df_welch, 2009/10/28
- [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, David Brown, 2009/10/29
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Erik Christiansen, 2009/10/29
- Re: [avr-gcc-list] Re: optimizer removes volatile pin access code. why?, Erik Christiansen, 2009/10/29