AVR-GCC a expanze makro

Zdenek Janis zdenek.janis@brajan.cz
Úterý Prosinec 6 18:40:45 CET 2005


a takhle by to neslo?

#define	mujport	PORTA
#define	mujpin	0

#define	pinset(bit) mujport |= (1<<bit)

void fnc() {
	pinset(mujpin);
}


Hynek Sladky wrote:
> #define	pinset(port,bit) port |= (1<<bit)
> #define	mujpin	PORTA, 0
> 
> funkce () {
>    pinset (mujpin);
> }
> 
> Prekladac ale hlasi:
> eval.c:87:13: macro "pinset" requires 2 arguments, but only 1 given
> eval.c: In function `funkce':
> eval.c:87: error: `pinset' undeclared (first use in this function)

-- 
S pozdravem
                Zdenek Janis



Další informace o konferenci Hw-list