Declaring N as volatile is a good solution.
The alternative is to disenable optimization on GCC (-o0) but I don't think
you will like the results.
Another solution is to put
asm(nop);
In your loop body. That will force the compiler to implement the loop.
There might be some fancier
Javier Almansa Sobrino [EMAIL PROTECTED] wrote:
Any one knows what option I must to pass to AVR-GCC when compile to
avoid this.
The best option is to don't try rolling your own loops at all.
Instead, use the functions from util/delay.h. There are two
functions (with a different argument