[fpc-pascal] AVR Busy Wait implementation

Jeppe Johansen jeppe at j-software.dk
Sun Jan 17 23:56:26 CET 2016



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?


More information about the fpc-pascal mailing list