Re: Problem linking *without* avr-libc, libm, etc. (SOLVED)
David Kelly <[email protected]> Fri, 30 Apr 2021 19:11:44 -0500
| Newsgroups | gmane.comp.hardware.avr.gcc |
|---|---|
| Message-ID | <[email protected]> |
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, [email protected] ============================================================ Whom computers would destroy, they must first drive mad.