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

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

Re: [avr-gcc-list] inline'ing sbi/cbi...


From: Herb Peyerl
Subject: Re: [avr-gcc-list] inline'ing sbi/cbi...
Date: Mon, 12 Jan 2004 11:37:00 -0700

"Dave Hansen" <address@hidden>  wrote:
 > Why "obviously?"  Because of the preprocessor?  If so, try something like 
 > this:
 > 
 >    #define Do_The_Work(p, m) p |= m
 >    #define Turn_On(pm)       Do_The_Work(pm)
 >    #define MY_BIT            PORTB, 0x04
 > 
 >    unsigned char PORTB;  /* Dummy to allow compile */
 > 
 >    void try_it()
 >    {
 >       Turn_On(MY_BIT);  /* preprocessor produces "PORTB |= 0x04;" */
 >    }
 > 
 > I'm fairly sure you can adapt this to your needs.

Yes, of course.  I'm too old to think outside the box anymore.

Thanks.



reply via email to

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