avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os


From: Stu Bell
Subject: RE: [avr-gcc-list] Avr-gcc Produces Incorrect Code with -Os
Date: Fri, 16 May 2008 14:16:29 -0600

>> The PORTA bits are used for hardware control.  I want to use the
>> atan2(), etc. calls as pulse stretching.
>>
>> Then I recommend using the calls in <util/delay.h> to get exact
delays 
>> instead of monkeying around with floating point routine calls.  
>> They'll be a lot more exact as well as being a boatlad smaller!
>
>Perhaps the atan2() call are accomplishing useful work...

Perhaps so.  However, if all they are doing is "pulse stretching" as was
indicated, a flat delay is better.

That said, I thought the OP was originally using the PORTA bit flipping
as a simple way to time how long each given function takes, perhaps as a
calibration or benchmarking exercise.  I found the fact that sin, cos,
and so on worked, but atan2 didn't, the most interesting part of the
discussion.

And I think the answer to that has been adequately explained (look-up
tables not affecting volatility, etc.).  Then we branched off into
whether "clobber memory" is the best way to handle sei() and cli().
Again, a fun discussion.

Enough explanation of my comments.  Back to the argument, which is
already in progress... ;-)

Stu




reply via email to

[Prev in Thread] Current Thread [Next in Thread]