[En-Nut-Discussion] AVR: Equalizing names

Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Fri Sep 7 19:09:10 CEST 2012


Hello,

e.g. in nut/arch/avr/dev/ih_timer0_comp.c we have
#if defined(MCU_AT90CAN128) || defined(MCU_ATMEGA2560) || defined(MCU_ATMEGA2561)
#define INT_MASK_REG    TIMSK0
...
#else
#define INT_MASK_REG    TIMSK
...
#endif

Wouldn't a construct like

#if defined(TIMSK0)
#define INT_MASK_REG    TIMSK0
#else
#define INT_MASK_REG    TIMSK
#endif

make it easier to port to new devices? Otherwise the list of devices may
grow long with many devices supported.

Or maybe some AVR family related defined can be used like for above

#if defined(_AVR_IOCANXX_H_) || defined(_AVR_IOMXX0_1_H_)

Optinions?

Thanks
-- 
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