| ??? 05/12/09 13:43 Read: times |
#165263 - Code to Get command Responding to: ???'s previous message |
The next is the code that I did, but some times work and some time it does not work, maybe I have a wrong with de intialization of flags or something.
...insert code here[/
void serial_int () interrupt 4
{
static char index;
static int State;
if (RI == 1)
{
RI= 0;
switch (Estado)
{
case WAITING:
if ( SBUF == 'X')
{
indice = 0;
State = RECEPTION;
}
break;
case RECEPTION:
if ( SBUF != ' ')
{
Buff_RX[index] = SBUF;
index ++;
}
else
{
Buff_RX [indice] = ' ';
FlagCommandProccesor = 1;
State = WAITING;
}
break;
}
}
}]
|



