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

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

[avr-gcc-list] Question about gcc preprocessing and port/pin assignments


From: James Washer
Subject: [avr-gcc-list] Question about gcc preprocessing and port/pin assignments
Date: Sun, 5 Dec 2004 22:19:17 -0800


I'd like to be able to say something like

#define switch PB7
.
.
.
setpin(PB7)

and have the following code generated

PORTB |= 1<<7


What I'm hoping for is the ability to change the definition of "switch" at any 
time, and have everything work

For example

if I change switch to PD2, the preprocessor would (auto)magically arrange for 
the following code

PORTD |= 1<<2


Any ideas?

 - jim


reply via email to

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