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

The extern and non-extern variables

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