[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-chat] casting problems?
From: |
Steve Franks |
Subject: |
[avr-chat] casting problems? |
Date: |
Thu, 27 Apr 2006 08:32:41 -0700 |
Hi all,
Anybody care to take a stab at why:
#include <stdint.h>
__inline__ void rx_addr(uint8_t a){tx( (uint8_t)(0x40) | a );}
Gives me:
C:/projects/include/test.hpp:84: error: call of overloaded `tx(int)' is ambiguous
Given that I have both:
void tx(uint16_t)
void tx(uint8_t)
defined in test.hpp.
I think the problems started with the upgrade from winavr 2005 to winavr 2006.
Also, if I change to:
__inline__ void rx_addr(uint8_t a){tx( (uint8_t)(0x0040 | (uint16_t)(a)) );}
The project builds, and tx(uint8_t) is called correctly, but from using the debugger, I have discovered that the 0x10 I pass in goes out to tx() as 0x10, not 0x50 like it should be.
I have built with both -Os and -O0, so it's not an optimization issue (why do we always blame the optimizer ;)
???
I'm going crazy here.
Thanks,
Steve
- [avr-chat] casting problems?,
Steve Franks <=