|
|||||||||||
Technical Support Support Resources
Product Information |
C51: Declaring External sbit VariablesInformation in this article applies to:
SYMPTOMSI 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:
However, when compiling I get a syntax error. What am I doing wrong? RESOLUTIONWhen declaring an sbit as extern, you must use the 'bit' type. For example:
Note: this only works for sbit variables in the bit-addressable memory range 0x20 - 0x3F and not for SFRs declared with sbit. MORE INFORMATION
Last Reviewed: Thursday, February 25, 2021 | ||||||||||
|
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.