Why in this code the array index "next_in" increments automaticaly when there is an interrupt.
Why when I try to fill the arrays buffer and buffer_temp they got dferent data?
Code:
#int_rda
void rx_serial_data()
{
byte t;
char ch;
count +=1;
ch=getc();
buffer[next_in] =ch; // get the data(single character) from serial port
buffer_temp[next_in]=ch;
t=next_in;
if (buffer[next_in]=0x0A)
++count_lf;
if (count_lf=2)
end_message=true;
next_in=(next_in+1) % BUFFER_SIZE;
if(next_in==next_out)
next_in=t; // Buffer full !!
}
Sending a "AT" command to a GSM modem, this is what I got using the ICD2
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum