Re: [avr-gcc-list] Preprocessor question

2008-05-05 Thread Paulo Marques
Thomas D. Dean wrote: Thanks, I re-read 'info cpp' and think I may actually understand it. BTW, I use a different trick for pin access macros that has been posted before on this list (can't find the reference now, sorry). I use the attached include file. Then I define my hardware pins like

Re: [avr-gcc-list] Preprocessor question

2008-05-05 Thread Thomas D. Dean
Thanks, That is close to what I have. I like a couple of your names better. I will change. tomdean ___ AVR-GCC-list mailing list AVR-GCC-list@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Re: [avr-gcc-list] Preprocessor question

2008-05-05 Thread Paulo Marques
Thomas D. Dean wrote: Thanks, That is close to what I have. I like a couple of your names better. I will change. Hummm it didn't seem close to what you've shown. The main difference is this: #define LEFT_MOTOR_DIR_PORT PORT(C) #define LEFT_MOTOR_DIR_PIN PIN(3) #define

[avr-gcc-list] Preprocessor question

2008-05-02 Thread Thomas D. Dean
I have a question about preprocessor syntax. I want to declare som macros that ease controlling port assignments. in the include file, I have #define GLUE(a, b) (a##b) #define PORT(x)(GLUE(PORT, x)) #define PIN(x) (_BV((x))) #define DDR(x) (GLUE(DDR, x)) #define

Re: [avr-gcc-list] Preprocessor question

2008-05-02 Thread Preston Wilson
Thomas D. Dean wrote: I have a question about preprocessor syntax. I want to declare som macros that ease controlling port assignments. in the include file, I have #define GLUE(a, b) (a##b) #define PORT(x)(GLUE(PORT, x)) #define PIN(x) (_BV((x))) #define DDR(x)