Keil Logo

C51: DECLARING EXTERNAL SBITS


Information in this article applies to:

  • C51 Version 5.50
  • C51 Version 6.00 Beta
  • C51 Version 6.00

SYMPTOMS

I have declared an sbit called foo in a source file called bar.c. In another source file, I have tried to declare the sbit as extern:

extern sbit foo;

However, when compiling I get a syntax error. What am I doing wrong?

RESOLUTION

When declaring an sbit as extern, you must use the 'bit' type. For example:

extern bit foo;

MORE INFORMATION

  • Refer to sbit in the Cx51 User's Guide.
  • Refer to bit in the Cx51 User's Guide.

FORUM THREADS

The following Discussion Forum threads may provide information related to this topic.

Last Reviewed: Monday, October 16, 2006


Did this article provide the answer you needed?
 
Yes
No
Not Sure
 
  Arm logo
Important information

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies.

Change Settings

Privacy Policy Update

Arm’s Privacy Policy has been updated. By continuing to use our site, you consent to Arm’s Privacy Policy. Please review our Privacy Policy to learn more about our collection, use and transfers
of your data.