|
From: | Dusan Ferbas |
Subject: | RE: [avr-gcc-list] eicall on ATmega2561 |
Date: | Fri, 08 Aug 2008 10:31:24 +0200 |
*sigh* Okay, now you're forcing me to work. ;-)
I'll start with EIND. The return value is a bit of a "red herring" as
it doesn't really have much to do with the problem but is instead an
artifact of how you are trying to solve the problem. EIND is used in
only two instructions: EIJMP and EICALL. You don't really care what the
value is after you return from the EICALL, since you will need to set it
up next time for your *next* EICALL. Same argument for EIJMP. In other
words, stop obsessing about EIND. So long as it is set to 1 before you
call the bootloader function from app space, you're golden.
Second, stop assigning C variables to registers. It doesn't really
improve anything and, as you found out, makes your life miserable. If
you think it makes faster code, I counter with the mantra, "*FIRST* make
it work, *THEN* make it fast". You have yet to make it *work*, so you
don't pass step one of the mantra.
By the way, the "register" keyword is considered a hint by GCC, and
barely that. GCC tends to ignore you, but then pays heed at the most
inopportune time. Especially do not consider the register keyword to
apply across separate compile modules.
[Prev in Thread] | Current Thread | [Next in Thread] |