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

Keil error C129

I am just getting started in coding the cypress FX2 in C.
I was trying a very simple, port toggle example code. But I get the following error "FX2REGS.H(38): error C129: missing ';' before 'GPIF_WAVE_DATA'"

I haven't changed the FX2REGS.H, its as is from the INC folder. I searched for the error, keil online database says, it might be due to a missing ";" in the previous line.
Here's the part of the code that's causing the error
(line 8 here).

#ifdef ALLOCATE_EXTERN
#define EXTERN
#define _AT_ _at_
#else
#define EXTERN extern
#define _AT_ ;/ ## /
#endif

EXTERN xdata volatile BYTE GPIF_WAVE_DATA    _AT_ 0xE400;
EXTERN xdata volatile BYTE RES_WAVEDATA_END  _AT_ 0xE480;

Parents
  • This is what the comments say before the defines

    // The Ez-USB FX2 registers are defined here. We use FX2regs.h for register
    // address allocation by using "#define ALLOCATE_EXTERN".
    // When using "#define ALLOCATE_EXTERN", you get (for instance):
    // xdata volatile BYTE OUT7BUF[64]   _at_   0x7B40;
    // Such lines are created from FX2.h by using the preprocessor.
    // Incidently, these lines will not generate any space in the resulting hex
    // file; they just bind the symbols to the addresses for compilation.
    // You just need to put "#define ALLOCATE_EXTERN" in your main program file;
    // i.e. fw.c or a stand-alone C source file.
    // Without "#define ALLOCATE_EXTERN", you just get the external reference:
    // extern xdata volatile BYTE OUT7BUF[64]   ;//   0x7B40;
    // This uses the concatenation operator "##" to insert a comment "//"
    // to cut off the end of the line, "_at_   0x7B40;", which is not wanted.
    
    

Reply
  • This is what the comments say before the defines

    // The Ez-USB FX2 registers are defined here. We use FX2regs.h for register
    // address allocation by using "#define ALLOCATE_EXTERN".
    // When using "#define ALLOCATE_EXTERN", you get (for instance):
    // xdata volatile BYTE OUT7BUF[64]   _at_   0x7B40;
    // Such lines are created from FX2.h by using the preprocessor.
    // Incidently, these lines will not generate any space in the resulting hex
    // file; they just bind the symbols to the addresses for compilation.
    // You just need to put "#define ALLOCATE_EXTERN" in your main program file;
    // i.e. fw.c or a stand-alone C source file.
    // Without "#define ALLOCATE_EXTERN", you just get the external reference:
    // extern xdata volatile BYTE OUT7BUF[64]   ;//   0x7B40;
    // This uses the concatenation operator "##" to insert a comment "//"
    // to cut off the end of the line, "_at_   0x7B40;", which is not wanted.
    
    

Children