|
sfr P1 = 0xFF; /* WATCHDOG TIMER CONTROL */
typedef union
{
unsigned char byte;
struct
{
unsigned char _FlagMenu:1,_FlagAtt:1,_KeyLow:1,_Enter:1,_FlagMMDS:1,_KeyHigh:1; /*0,1..7*/
}hh;
}dw1b;dw1b CodeKey;
#define FlagAttenuator CodeKey.hh._FlagAtt
void ttt();
void main (void)
{CodeKey.byte = ~P1 & 0x07;
if (FlagAttenuator) P1=0;
ttt();
}в другом файле:
sfr P1 = 0xFF; /* WATCHDOG TIMER CONTROL */typedef union
{ unsigned char byte;
struct
{unsigned char _FlagMenu:1,_FlagA:1,_KeyLow:1,_Enter:1,_FlagS:1,_KeyHigh:1;}hh;
} dw1b;
extern dw1b CodeKey;void ttt()
{
CodeKey.byte = ~P1 & 0x07;
E-mail: info@telesys.ru