|
bit WaitClrBusy(void)
{unsigned char a;
a=0;
while (a<200)
{a++;
if (BUSY==0) return(1);
delay_time(100);
}
//Зависла шина
XBR0&=0xFE; //Отключить СМБуф
a=0;
while (a<200)
{a++;
SDO=1;SCL=1;
delay_time(100);
SCL=0;
delay_time(100);
SCL=1;
delay_time(100);
if (SDI==1){XBR0|=0x01; return(1);}
}
return(0);
}
E-mail: info@telesys.ru