[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Compiler warning
From: |
E. Weddington |
Subject: |
Re: [avr-gcc-list] Compiler warning |
Date: |
Mon, 25 Nov 2002 11:59:11 -0700 |
On 25 Nov 2002 at 13:21, David Breeze wrote:
> Can any one help!
>
> The code shown below always gives a compiler warning
>
> Compiling Button.c
> Button.c: In function `buttonReadPort':
> Button.c:123: warning: asm operand 0 probably doesn't match
> constraints
>
> I have tried various forms of coersion and no coersion for operand 0,
> the result is always the same.
>
> The compiler in use is the winbuild version from AVR Freaks site
> avr-gcc 3.0.2 dec 14, 2001.
>
> The code produced is what is required, so am I doing something wrong?
> or is this a compiler bug?
>
> (Sadly I cannot use the provided macros as they now fall foul of our
> recently tightened coding standards).
>
> static __inline__ u8 buttonReadPort(u8 port)
> {
> u8 result;
>
> __asm__("in %0,%1" : "=r" ((u8)(result)) : "I" (port) );
> return result;
> }
>
What exactly are you trying to do? Read a value from a port?
You say you cannot use the provided macros: which macros do you mean?
The macros to read a value from a port that comes with avrlibc?
Did you know that the AVRFreaks 3.0.2 distribution is not up-to-date?
Eric
avr-gcc-list at http://avr1.org