[Top][All Lists]

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

Re: [avr-gcc-list] Accessing structures defined in ROM ?

From: Andy Warner
Subject: Re: [avr-gcc-list] Accessing structures defined in ROM ?
Date: Mon, 26 Sep 2005 10:24:34 -0500
User-agent: Mutt/1.2.5i

Vincent Trouilliez wrote:
> [...]
>       i = pgm_read_byte( p->nb ); //should return 3, but doesn't...


        i = pgm_read_byte(&(p->nb));

After all, pgm_read_byte() takes the address of a byte to read,
so you need to pass it the _address_ of the object you want.

Andy Warner             Voice: (612) 801-8549   Fax: (208) 575-5634

reply via email to

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