[Top][All Lists]

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

[avr-libc-dev] RE: AVR-GCC: Mega 32

From: E. Weddington
Subject: [avr-libc-dev] RE: AVR-GCC: Mega 32
Date: Wed, 11 Dec 2002 10:44:30 -0700

On 11 Dec 2002 at 10:35, pfaff - Markus Pfaff wrote:

> Eric,
> I'll give the new release a try and keep you informed on the results.
> While upgrading my software to the Mega32 I ran into a strange
> problem: After adding some additional EEPROM variables (only adding
> them, not using) the whole design behaves strangely. Looking through
> the libc documentation I found that the function
> uint8_t eeprom_read_byte(uint8_t * addr)
>                          ^^^^^^^
> takes an 8-bit address only. 
> The eeprom_read_word function uses an address of typ uint16_t. Do you
> know something about the idea behind this? I was not able to figure
> out some casting around this problem. Reading words instead of bytes
> would not be an efficient solution to the problem.
> Markus

Notice that addr is a pointer to an 8-bit type. A pointer is 16 bits. 
So it takes a 16 bit address that points to an 8 bit type since it is 
reading a byte from the EEPROM.


reply via email to

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