i try isolated usb project and not sure why get a compiler error with this
typedef union c code as supplementary:
i use PIC18F2550 - boostC Compiler
i change BYTE in unsigned char in this example.
if i start with an empty PIC18F2550 project
and added this c code in supplementary for using
i get compiler error with 'missing brace'
..
Code: Select all
typedef union
{
unsigned char bitmap;
struct
{
unsigned char ep_num: 4;
unsigned char zero_pkt: 1;
unsigned char dts: 1;
unsigned char force_dts: 1;
unsigned char direction: 1;
}field;
} TRANSFER_FLAGS;
best wishes
rudi

Code: Select all
CODETEST.c(145): error: general error
CODETEST.c(145): error: missing right brace
CODETEST.c(145): error: general error
CODETEST.c(145): error: missing right brace
CODETEST.c(145): error: identifier expected
CODETEST.c(145): error: missing right brace
CODETEST.c(145): error: general error
CODETEST.c(145): error: missing right brace
CODETEST.c(145): error: general error
CODETEST.c(145): error: missing right brace
CODETEST.c(145): error: identifier expected
CODETEST.c(145): error: missing right brace
c code:
Code: Select all
133: /*=----------------------------------------------------------------------=*\
134: Use :Supplementary defines
135: \*=----------------------------------------------------------------------=*/
136: // #ifndef BYTE
137: // typedef unsigned char BYTE ;
138: // #endif
139:
140: typedef union
141: {
142: unsigned char bitmap;
143: struct
144: {
145: unsigned char ep_num: 4;
146: unsigned char zero_pkt: 1;
147: unsigned char dts: 1;
148: unsigned char force_dts: 1;
149: unsigned char direction: 1;
150: }field;
151: } TRANSFER_FLAGS;