avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Preprocessor question


From: Paulo Marques
Subject: Re: [avr-gcc-list] Preprocessor question
Date: Mon, 05 May 2008 18:37:46 +0100
User-agent: Thunderbird 1.5.0.14 (X11/20071210)

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 LEFT_MOTOR_DIR_DDR       DDR(C)

whereas in my version this is just:

#define LEFT_MOTOR_DIR           C,3

If you need to declare 20 I/O pins like this, it saves you 40 #define's, and it places the pin number next to the port name where it is easier to read.

--
Paulo Marques
Software Development Department - Grupo PIE, S.A.
Phone: +351 252 290600, Fax: +351 252 290601
Web: www.grupopie.com

"To be, or not to be? That is ..... liable to be removed at -O2 and above."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]