Цитата(IF_P @ Jan 2 2009, 17:40)

51-й проц. Keil 2 V2.36. Когда программа была в одном файле, все работало. Разнес программу в отдельные файлы и поставил описания extern. Со всеми переменными и битами разобрался, а вот одного п/п не видит. Может потому, что SFR бит? Помогите разобраться.
попробуйте "bdata". Смысл имхо в том что не все sbit без bdata могут быть extern
Bit-addressable ObjectsBit-addressable objects are objects that can be addressed as words or as bits.
Only data objects that occupy the bit-addressable area of the 8051 internal
memory fall into this category. The Cx51 compiler places variables declared
with the bdata memory type into this bit-addressable area. Furthermore,
variables declared with the bdata memory type must be global. You may declare
these variables as shown below:
Код
int bdata ibase; /* Bit-addressable int */
char bdata bary [4]; /* Bit-addressable array */
The variables ibase and bary are bit-addressable. Therefore, the individual
bits of these variables may be directly accessed and modified. Use the sbit
keyword to declare new variables that access the bits of variables declared using
bdata. For example:
Код
sbit mybit0 = ibase ^ 0; /* bit 0 of ibase */
sbit mybit15 = ibase ^ 15; /* bit 15 of ibase */
sbit Ary07 = bary[0] ^ 7; /* bit 7 of bary[0] */
sbit Ary37 = bary[3] ^ 7; /* bit 7 of bary[3] */
The above example represents declarations, not assignments to the bits of the
ibase and bary variables declared above. The expression following the carat
symbol (‘^’) in the example specifies the position of the bit to access with this
declaration. This expression must be a constant value. The range depends on
the type of the base variable included in the declaration. The range is 0 to 7 for
char and unsigned char, 0 to 15 for int, unsigned int, short, and unsigned
short, and 0 to 31 for long and unsigned long.
You may provide external variable declarations for the
sbit type to access these
types in other modules. For example:
Код
extern bit mybit0; /* bit 0 of ibase */
extern bit mybit15; /* bit 15 of ibase */
extern bit Ary07; /* bit 7 of bary[0] */
extern bit Ary37; /* bit 7 of bary[3] */
Declarations involving the sbit type require that the base object be declared with
the memory type bdata. The only exceptions are the variants for special
function bits.
Special function bits represent an independent declaration class that may not be
interchangeable with other bit declarations or bit fields.
The
sbit data type declaration may be used to access individual bits of variables
declared with the
bdata memory type specifier.