[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] mission: impossible
From: |
Joerg Wunsch |
Subject: |
Re: [avr-gcc-list] mission: impossible |
Date: |
Fri, 22 Feb 2002 16:57:53 +0100 (MET) |
[Btw., your article has a bad References line. It points to something
totally unrelated. Better not use "followup" mode when you're
actually starting a new thread.]
Victor Sluiter <address@hidden> wrote:
> #if serial number == 1
> #define LED1 PORTC,PC1
> #elif serial number == 2
> #define LED1 PORTC,PC2
> #endif
This is impossible to do. Remember, the above is a preprocessor
statement. As the name suggest, it is evaluated even /before/ the C
code is passed to the actual C compiler. So unless you can express
all of your serial number stuff as a C expression that is already
constant at cpp time, it's impossible. (You didn't write how you're
actually bringing that serial number down into the flash. So it still
/could/ be possible, like via some cute defines that are all known and
constant at compile-time.)
--
J"org Wunsch Unix support engineer
address@hidden http://www.interface-systems.de/~j/
avr-gcc-list at http://avr1.org