avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem linking *without* avr-libc, libm, etc. (SOLVED)


From: David Kelly
Subject: Re: Problem linking *without* avr-libc, libm, etc. (SOLVED)
Date: Fri, 30 Apr 2021 19:11:44 -0500

Has been a long time for me but Once Upon A Time it wasn’t just a matter of “not using functions in the library”. AVR-gcc required primatives other than startup code. It couldn’t do most operations on longs in-line, called library functions with names outside of usual C-space. I remember being concerned about using those inside an interrupt service routine. Unrolled my uint32_t in a union for ++ or — on the least significant 16, test and repeat in most significant if necessary for carry or borrow.

if( ! ++val.low ) ++val.high;

Or:
if( val.low || val.high ) // I like to count down to zero
if( val.low— ) val.high—;

Back then AVR-gcc was not smart enough to do the above automatically. 

I used a lot of uint32_t and uint64_t as counters to mark the passage of time.

--
David Kelly N4HHE, dkelly@HiWAAY.net
============================================================
Whom computers would destroy, they must first drive mad.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]