[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] writing EEPROM
From: |
Joerg Wunsch |
Subject: |
Re: [avr-libc-dev] writing EEPROM |
Date: |
Fri, 23 May 2003 16:37:18 +0200 |
User-agent: |
Mutt/1.2.5i |
As Artur Lipowski wrote:
> Is it worth to add such inlines to the eeprom.h?
I think so.
> static inline void eeprom_write_word (uint8_t *addr, uint16_t buf)
> {
> eeprom_write_byte(addr, buf);
> eeprom_write_byte(addr+1, buf>>8);
> }
Only thing: better use "uint16_t *addr", because it's going to point
to 16-bit entities. Of course, the address calculation inside the
inline function then needs the same (uint8_t *) typecast as is already
needed in eeprom_write_block().
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/