char getchar(void)
{
char data;
while (rx_counter==0) [COLOR="#FF0000"]wait_loop();[/COLOR]
data=rx_buffer[rx_rd_index++];
#if RX_BUFFER_SIZE != 256
if (rx_rd_index == RX_BUFFER_SIZE) rx_rd_index=0;
#endif
#asm("cli")
--rx_counter;
#asm("sei")
return data;
}
.
.
.
void wait_loop() {
if(PINB.1==0){
if(PINB.0==0){
delay_ms(60000);
if(PINB.1==0){
if(PINB.0==0){
E1=1;
if(a1<3) {
a1++;
PORTC.3=0;
send(e1);
delay_ms(100);
PORTC.4=0;
delay_ms(2000);
PORTC.3=1;
PORTC.4=1;
delay_ms(20000);
};
};
};
};
}
else {
if(E1==1) {
E1=0;
a1=0;
send(e1ok);
PORTC.3=0;
delay_ms(2000);
PORTC.3=1;
delay_ms(20000);
};
};
}