[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-libc-dev] Change EEPROM SFR definition.
From: |
Anatoly Sokolov |
Subject: |
[avr-libc-dev] Change EEPROM SFR definition. |
Date: |
Thu, 30 Jun 2005 00:43:54 +0400 |
Hello.
In new ATMega devices EEPROM support registers are located to other
addresses than in AT90S/old ATMega/ ATTiny, it does illogical and error
prone the generalized definition of these registers in IO.h. I suggest to
change the order of definition EEPROM registers as follows:
1.To define EEPROM SFR and corresponding bits in device ioXXXXX.h files.
2. In io.h for support EEPROM library define EEPROM SFR only if any of __
AVR_device __ is not defined and defined __ COMPILING_AVR_LIBC __.
i.e.:
.....
#elif defined (__AVR_ATtiny11__)
# include <avr/iotn11.h>
#else
# if defined(__COMPILING_AVR_LIBC__)
/* In order to assemble the EEPROM library components without
* defining a specific device, we keep the EEPROM-related
* definitions here.
*/
# define EECR, EEDR, EEAR, EEARL, EEARH,
# define EERIE, EEMWE, EEWE, EERE
# else
# warning "device type not defined"
# endif
#endif
It will allow :
1. Fix bug #13290: avr/io.h EEAR def is flawed for the Mega48
2. To facilitate realization of a task #3586: Change from avr architectures
to lib per device.
What your opinion on such changes?
Anatoly.