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;
well, I need more help.
I tried using preprint in debug. FX2REGS.H PREPRINT
Is that correct? I get "error34: undefined identifier"
I have no idea. I am just getting started in C. You need to read a bit more before you start banging the keys. There are many good books about C, my favorite is Kochan: programming in ANSI C
If, as you say, you are just getting started in C, get your feet wet writing code for the PC and then, when you have the basics down pat, have a go at the micros
Erik
Let me rephrase: I am getting started in embedded C. I am in no way an expert on C. But I have coded in C on PC, not Microcontrollers. All my uC was in assembly.
"I tried using preprint in debug. FX2REGS.H PREPRINT"
Compile the C source file(s) that include FX2REGS.H.
I get the same error "*** error 34: undefined identifier"
Do you actually understand what the 'C' preprocessor is, and what it does?
If not, it's time to go back to the 'C' textbook; this is standard stuff - nothing peculiar to C51.