|
From: | Frederik Rouleau |
Subject: | Re: [avr-gcc-list] heed help for the C Preprocessor |
Date: | Mon, 14 Jun 2004 14:25:41 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.6) Gecko/20040113 |
Try something like this: #define SDA_PORT C #define _SDA_DIRECTION(X) DDR##X #define SDA_DIRECTION(X) _SDA_DIRECTION(X) The presence of ## prevent the preprocessor to substitute. Ivan Dimitrov wrote:
hi all when i'm using #define SDA_PORT C #define SDA_DIRECTION(X) DDR##X and in function foo() SDA_DIRECTION(SDA_PORT) |= 64;so, i am getting DDRSDA_PORT |= 64; instead of DDRC |= 64;how have i write a #def ine to get the right macro? (DDRC |= 64;) Regards I. ------------------------------------------------------------------------ _______________________________________________ avr-gcc-list mailing list address@hidden http://www.avr1.org/mailman/listinfo/avr-gcc-list
[Prev in Thread] | Current Thread | [Next in Thread] |