On 01/17/2016 11:15 PM, Florian Klämpfl wrote:
Am 17.01.2016 um 22:01 schrieb Simon Ameis:
I've now come up with the code below.

The main problem is, that FPC doesn't inline the procedure _delay_ms.
Thus the calculation of the required ticks is done at runtime wich
timing is merely unpredictable.

What must be done to get this procedure inlined?

Here it does. Did you add {$inline on} ?
It probably doesn't if delay_loop_1 and delay_loop_2 are private procedures inside a unit referenced from another unit. Then _delay_ms would be a procedure referencing the static symbol table. Could that be what's going on?
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to