[Top][All Lists]

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

Re: [avr-gcc-list] AVR GCC compiler for win98

From: Rob Ward
Subject: Re: [avr-gcc-list] AVR GCC compiler for win98
Date: Fri, 19 Apr 2002 08:19:10 +1200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9) Gecko/20020311

Hi. I am using GCC under w2k. I tried using this code from avrfreaks...

#define sw4_pin (1<<4) //this could be (1<<PD4)
#define sw4_port PORTD
#define sw4_dir DDRD
#define sw4_in PIND

Then the following to toggle the pin / i/o direction...

sw4_dir &= ~sw4_pin;//set port as input
sw4_port |= sw4_pin; //switch on pull up

however, I get "Invalid lvalue in assignment" for both the last two lines when compiling. Could anyone tell my why this is?

I don't want to use the __sbi and __cli macros as they take two clock cycles to execute, whereas and'ing and or'ing the registers directly only takes one clock cycle (as far as I understand it).


Rob Ward
avr-gcc-list at http://avr1.org
reply via email to

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