Hello, i did project with the device: cypress EZ-USB FX2LP and i am trying change register values.
#include <fx2.h> #include <FX2REGS.h> #include <stdio.h> void main(void){ SCON0 = 0x52; TMOD = 0x20; TCON = 0x69; TH1 = 0xf3; WAKEUPCS = bmWU | bmWUPOL | bmWUEN; printf ("Register"); printf ("\n\nC compiler demonstration program\n\n"); while (1) { printf("Running"); } }
With rebuilding he issues 2 Warning:
*** WARNING L1: UNRESOLVED EXTERNAL SYMBOL SYMBOL: WAKEUPCS MODULE: main.obj (MAIN) *** WARNING L2: REFERENCE MADE TO UNRESOLVED EXTERNAL SYMBOL: WAKEUPCS MODULE: main.obj (MAIN) ADDRESS: 0C2DH
In module FXREGS.h next code:
EXTERN xdata volatile BYTE WAKEUPCS _AT_ 0xE682; // Wakeup source and polarity
And so is it actually *defined* anywhere, or is it always external?
http://www.keil.com/dd/docs/c51/cypress/fx2regs.h
... // 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: ...
Read, understand, proceed