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

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

RE: [avr-gcc-list] Comma Operator in #define


From: E. Weddington
Subject: RE: [avr-gcc-list] Comma Operator in #define
Date: Wed, 23 Jul 2003 16:46:00 GMT

> 
> Why not define an inline function for your code? It will 
have the same
> effect as a #define, but be safer.
> 
> (in a header file):
> extern inline void set_clock(uint8_t x) { 
>       asm volatile("nop\n\t"::);
>       PORTB |= BIT3;
> }
> 

Sometimes I've had problems getting GCC to properly inline 
functions. Sometimes it's easier to just write a macro 
instead. Perhaps that's why Keith wants to go this
route.




reply via email to

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