Re: Help needed in dereferencing a union



On Tue, 31 May 2005 19:25:27 +0200, jlara <jlara@xxxxxxxxxx> wrote:

typedef union
{
   uint8 byte;
  struct
   {
      uint8       : 4;

uint8 bla : 4;

      uint8 tffca : 1;
      uint8 tsfrz : 1;
      uint8 tswai : 1;
      uint8 ten   : 1;   /* timer enable */
   }bit;
}tSCR1;

#define scr1 (*(tSCR1 *)(0x4c))

scr1.bit.ten = 1; /* the compiler complains about this */

No, it complains about a missing field name in bit.

Jirka
.