void read_zigbee(void)
{
if(read_count!=count) //checking is there any unread data?
{
if(read_count==25) //go back to start position of array
read_count=0;
read[read_count]=zigbeerxd[read_count];//read the data
if(i==1)
{
if(read[read_count]==end_header)
{
k=0;//reset the values
i=0;
read_count++;
time++;
get_raw=1;//raise the get_raw flag
}
else if(k<=7)//To prevent array over flow
{
rawdata[k]=read[read_count];//store the data in rawdata[]array
k++;
read_count++;
}
void serial_int(void) interrupt 4
{
if(RI_0==1)
{
if(count==25) count=0;
zigbeerxd[count]=SBUF0; //Storing the data from serial buffer into array
count++; //increase the count
RI_0=0;
}
}