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

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

Re: [avr-gcc-list] simple macro to dig w/ ports


From: Bjarne Laursen
Subject: Re: [avr-gcc-list] simple macro to dig w/ ports
Date: Fri, 24 Mar 2006 08:24:53 +0100
User-agent: Mozilla Thunderbird 0.7.3 (Windows/20040803)

Jkx wrote:

I want to transform this:
- sbi(PORTD,PD6)
- to something like sbi(PD6) (yes i use a the old fashion
 sbi/cbi code, because I'm a old fashion guy:)
I often define 2 macros for each port pin like:

#define LED1_ON() PORTB|=0x40
#define LED1_OFF() PORTB&=~0x40

#define CS_ENABLE() PORTB&=~0x01
#define CS_DISABLE() PORTB|=0x01

that way I also abtract away from the polarity of the pin.

-Bjarne Laursen, RoseTechnology A/S




reply via email to

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