Hi, As I was in the progress of learning 8051(specifically F340 uC from Silabs) with Keil C51 compiler. I came across this extern variable. This is what happen, hope somebody can enlighten me:
In the USB_HID example -> Blinky project, this variable USB_STATE was defined as unsigned char in F3xx_USB0_InterruptServiceRoutine.c, also in F3xx_USB0_StandardRequests.c this variable was externed, and this two file was part of the Blinky project.
Why not use only one extern variable? How C51 handle this thing? Why the compiler not complaining?
Thanks in advance.
regards gi
Be careful. The extern does not specifically indicate a declaration.
extern unsigned char USB_STATE = 0; // This is the Definition; // This is what actually causes memory to be allocated