David VanHorn wrote:
F_CPU is always evaluated upon each invocation, so if you ever change
it within one compilation unit, the next invocation of one of these
macros will reflect this.

That's compile-time, he's looking for execution-time changes in processor
speed.
He didn't explicitly say so, but I think he's using xdiv to scale the CPU
clock.

Sure, but he can create wrappers: fast_clk_delay(100); slow_clock_delay(100); and so forth. If the selection must be made at run time, that can be done with a switch() statement that knows the current clock speed.

-dave


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to