There is a lot of useful information in avr-gcc code, once you can see past
the peculiarities of C. See the implementation of avr-gcc's delay here:
cvs.savannah.gnu.org/viewvc/avr-libc/include/util/delay.h and delay_basic.h
in the same folder. Basically they use op codes with fixed cpu cycles to
construct the inside of the loop and use compile time constants to
calculate the number of iterations required for a delay. The focus of the
code is to get accurate delays down to a few cpu cycles.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to