This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Report a BUG

Under UV3 IDE
Compiler GCC331(down load from http://www.keil.com)
MCU = ADuC7026

I define a union
like:

typedef union _epp_flags
{
struct _flags
{
unsigned char timer : 1;
unsigned char bus_reset : 1;
unsigned char suspend : 1;
unsigned char setup_packet : 1;
unsigned char remote_wakeup : 1;
unsigned char in_isr : 1;
unsigned char configuration : 1;
unsigned char verbose : 1;
unsigned char ep1_rxdone : 1;
unsigned char power_down : 1;
unsigned char control_state : 2;
unsigned char setup_dma : 2;
unsigned char dma_state : 2;
} bits;
unsigned short value;
} EPPFLAGS;

then define a varible like :

EPPFLAGS bEPPflags;

the Compiler will make
the bEPPflags.bits.timer at the lowest byte's lowest bit of union but the IDE
thought the the bEPPflags.bits.timer at the
lowest byte's highest bit!!

So under Simulation debug,
after executed bEPPflags.bits.timer = 1;
In Watch Window you will find the bEPPflags.bits.verbose(8th variable) change to 1 and bEPPflags.bits.timer is still 0!!!

Which mean that the UV3 IDE and GCC compiler have different order to allocate variable in the union!!!

So the Watch Window give the wrong answer!!!

0