Georg-Johann Lay wrote:
> As I already wrote, the right C-level condition is
>
> if (&LED1_DDR == &LED2_DDR)
>
> You don't want to /read/ from the ports.
Sure, yes. I should have read your previous posting more
thoroughly.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
h
No the original suggestion of (&LED1_DDR == &LED2_DDR) is necessary because
of the way the DDRs are defined (they are the value of register)... the
ampersands get you back to the register address, which is more likely what
you are trying to determine with such a statement.
Vic
On Sun, Jun 3, 2012
Joerg Wunsch schrieb:
Georg-Johann Lay wrote:
Could anyone explain this to me? Is there any way around this
(still using macros)?
With macros? No way here.
Well: no way *at the preprocessor level*.
However, moving the comparison to the *compiler level* could work.
The values of e.g. DDRD
Georg-Johann Lay wrote:
>> Could anyone explain this to me? Is there any way around this
>> (still using macros)?
> With macros? No way here.
Well: no way *at the preprocessor level*.
However, moving the comparison to the *compiler level* could work.
The values of e.g. DDRD and DDRB are expres
Karol Babioch schrieb:
I'm currently trying to check whether two macros are equal to each
other. The idea is to generate different code, when they are equal,
which basically means that they are connected to the same port.
Basically it looks something like this:
#define LED1_DDR DDRD
#define
Hi,
I'm currently trying to check whether two macros are equal to each
other. The idea is to generate different code, when they are equal,
which basically means that they are connected to the same port.
Basically it looks something like this:
#define LED1_DDR DDRD
#define LED2_DDR DDRD
#if L