[En-Nut-Discussion] Byte select macros

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Mon Nov 22 23:37:25 CET 2010


>>>>> "Bernd" == Bernd Walter <enut at cicely.de> writes:

    Bernd> On Mon, Nov 22, 2010 at 08:08:45PM +0100, Uwe Bonnes wrote:
 
    Bernd> Is any of your variables declared volatile?

Yes, that's part of the problem.

But try
==
extern unsigned char *res;
extern unsigned short *input;

void
foo()
{
        res[0] = input[0] & 0xff;
        res[1] = input[0] >> 8;
        res[2] = input[1] & 0xff;
        res[3] = input[1] >> 8;
}
==
with
/tmp> avr-gcc -Os -Wall -c test.c
/tmp> avr-objdump -S test.o | less

8-(

-- 
Uwe Bonnes                bon at elektron.ikp.physik.tu-darmstadt.de

Institut fuer Kernphysik  Schlossgartenstrasse 9  64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------



More information about the En-Nut-Discussion mailing list