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

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

[avr-gcc-list] strange _BV() stuff


From: Torsten Hahn
Subject: [avr-gcc-list] strange _BV() stuff
Date: Tue, 15 Jul 2003 13:27:03 +0200

Hi Folk,

i wanted to set the a port on my atmega chip to an specific output using the _BV() macro defined in the avr-libc.

example:

#define DDS_WR 0
#define DDS_RB 1

...

PORTB = (_BV(DDS_WR | DDS_RB));

This should set the pin0 and the pin1 of PORTB to high. But it does not !

_BV((DDS_WR | DDS_RB) evaluates to 2, but it should evaluate to 3 if pin0 and pin1 should be set.

Do i miss something ?

avr-gcc --version
avr-gcc (GCC) 3.2 20020614 (experimental)

cu,
Torsten.
--
Dipl. Nat. Torsten Hahn
Institut für Experimentelle Physik / TU Bergakademie Freiberg
mail: address@hidden
Tel.: +49 (0) 3731 392670


reply via email to

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