avr-chat
[Top][All Lists]
Advanced

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

[avr-chat] register locked vars, some suggested tweaks to FAQ


From: Britton Kerin
Subject: [avr-chat] register locked vars, some suggested tweaks to FAQ
Date: Fri, 15 May 2015 10:22:26 -0800

I got register-locked vars working right now.  I think.  The trick was to
recompile all my source files with -ffixed-r2, -ffixed-r3, etc.

My remaining question is: is this enough, or do I need to recompile the avr
libc sources as well for it to be safe?  I'm guessing since the FAQ advises
to use r2 through r7, it normally saves and restores these registers itself
if it uses them?

Finally, I think it might be useful to mention the need to put the register
declarations before all function definitions in a single source file, and
to use -ffixed-r? when compiling other source files for the same program,
in the FAQ question about how to use register-locked vars.  Although these
things are covered in the GCC manual, its a little trouble to dig them out
and the mention of how to do register vars in the FAC creates an expectation
that the one-liner given does the work.

If anyone agrees I'll submit a patch.

Thanks,
Britton



reply via email to

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