[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] [Bug] Initialization for _delay_loop_2 Optimized Out
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] [Bug] Initialization for _delay_loop_2 Optimized Out |
Date: |
Thu, 24 Jul 2003 11:53:31 +0200 (MET DST) |
As "Dave Hansen" <address@hidden> wrote:
>#define CLOCKS_PER_US ((U16)(OSC_FREQ/1000000))
>#define CLOCKS_PER_LOOP 4
You remember that all these calculations are done using the `int' data
type, i. e. a 16-bit one, unless you force it to become long, do you?
So unless your OSC_FREQ macro has an `L' added somewhere, the above
division might become 0.
>static inline void
>my_delay_loop(unsigned int __count)
Identifiers with leading underscores are reserved (for ``the
implementation'') by the C standard. Please stay away from them
inside your application, or you might risk a name clash with the
compiler or library.
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/