On Fr, 2016-01-15 at 08:48 +0200, Christo Crause wrote: > There is a lot of useful information in avr-gcc code, once you can see past > the peculiarities of C.
I agrre, but normally I don't need such precision. If working in a millisecond range it's really overkill to use less than 100 nanosecond accuracy, me thinks. Well, if writing hard realtime OS timing functions or precise measuring algorithms, that would be good. > 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. Thanks for the link. > 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. I've written some program parts in ARM Assembler, but generally I like to avoid using it because of portability. -- Marc Santhoff <m.santh...@web.de> _______________________________________________ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal