|
typedef union
{
volatile unsigned char byte;
struct
{
volatile unsigned char bit_0:1;
volatile unsigned char bit_1:1;
volatile unsigned char bit_2:1;
volatile unsigned char bit_3:1;
volatile unsigned char bit_4:1;
volatile unsigned char bit_5:1;
volatile unsigned char bit_6:1;
volatile unsigned char bit_7:1;
} bit;
} PORT;
__io PORT PORTC_ @ 0x15;
__io PORT PINC_ @ 0x13;
#define LED PORTC_.bit.bit_0
#define Input1 PINC_.bit.bit_1
#define Input2 PINC_.bit.bit_2
void main(void)
{
....
....
if(Input1||input2) LED = 0; else LED = 1;
while(1);
}
E-mail: info@telesys.ru