the following code works well in AVR Studio 4
#define CPU_ATtiny261 2 ; CPU = ATtiny261 old system
#define CPU_ATmega328 6 ; CPU = ATmega328 new system, multi I/O
;-------------------------------------------------------------------------------
#define CPU CPU_ATmega328
#define PinDef(N, P, X) \
.equ N## = PORT##P##X \
.equ N##_PORT = PORT##P \
.equ N##_PIN = PIN##P \
.equ N##_DDR = DDR##P \
#if (CPU == CPU_ATmega328) ; #########################################
PinDef(LED1, B, 3)
#endif ; ###########################################################
basically also in AVR Studio 7
but with this failure message if the code is deactivated for alternative CPU type
#if (CPU == CPU_ATtiny861) ; #############################################
PinDef(LED1, B, 3)
#endif ; ###########################################################
Severity Code Description Project File Line Column Source Project Rank
Error Preprocessor: 'PinDef' called with 0 args, expected 3 Attiny861.ASM 127 0 Build 1
anybody any idea?
Thanks
discholz