[an error occurred while processing this directive]
|
//#pragma optimize = 0
__root void TComPort::RxData()
{
U8 tmp;
while((*ULSR & 1) != 0)
{
tmp = *URBR;switch(tmp)
{
case BEGIN_CHAR:
//Начало пакета
RxIndex = 0;
tmpRxBufferLength = RxBufferLength;
RxESC = false;
break;
case END_CHAR:
//Конец пакета
if(RxIndex == 0)break;
RxDataSize = RxIndex;
RxBuffer[RxIndex]=0;
RxIndex = 0;
RxComplete = true;
*UIER &= ~0x01;
return;
case ESC_CHAR:
//Прием ESC символа
RxESC = true;
break;
default:
if(RxESC)
{
RxESC = false;
tmp = ~tmp;
}
RxBuffer[RxIndex++]=tmp;
if(RxIndex >= RxBufferLength)
{
RxOvf = true;
RxDataSize = RxIndex;
RxBuffer[RxIndex]=0;
RxComplete = true;
*UIER &= ~0x01;
return;
}
break;
}
}
}
E-mail: info@telesys.ru