This function only runs during a hardware interrupt generated by the UART.
I use the Borland 'interrupt' function. The interrupt function then calls this 'sub function'...
The function does it's operations correctly, but during this it won't exit my do-while loop -triggered by the Done flag. And i'm surtain that the string has reached it's size.
If you need to see my interrupt function -i'll show you, but it's in this piece something goes wrong ;(
void RunTest(void)
{
int y=2;
unsigned char Done=0;
DrawMenu();
textbackground(CYAN);
textcolor(BLUE);
DrawBox(1,1,15,10);
clrscr();
printf("Tester...\n");
printf("Debug lines only\n");
do
{
if(serial.m_Bufferin !=serial.m_Bufferout)
{
serial.m_Buffer[serial.m_Bufferout]&=0x7f;
serial.m_NewCharReceived=serial.m_Buffer[serial.m_Bufferout];
serial.m_NewBarCode[serial.m_Index++]=serial.m_NewCharReceived;
serial.m_Bufferout++;
//printf("%c ->%d \n",serial.m_NewCharReceived,serial.m_Index);
if(strlen(serial.m_NewBarCode)==11)
{
cputs(serial.m_NewBarCode);
gotoxy(1,y++);
dat.m_pCodes[dat.m_Count++]=strdup(serial.m_NewBarCode);
serial.m_Index=0;
Done=1;
}
}
}while(!Done);
}